Jump to content
DiamondSea

[contribution] Simple Template System (sts)

Recommended Posts

The changes you make in product_info.php you will also need to make in sts_product_info.php and assign the appropriate information to a template variable.

 

Look at the difference between product_info.php and sts_product_info.php to see how it's done.

 

- Brian

 

i think i did do that already and than i get an error on the page so i really cant use the code with sts together

Share this post


Link to post
Share on other sites
Make an index-0 and strip the template of any tags, then place your product there?

 

Iggy

 

I am confused as to how I would "place my product there". I think that is my biggest problem. just hard to wrap my head around.

Share this post


Link to post
Share on other sites

Hi Guys,

 

I have a slight issue and I have no idea if its STS that is causing the problem. If yuo look at my site here and click on a couple of links everything seems to work great.

 

However, I have been working on the all products page (with a lot of help from stevel) and if you look here at the all products page you will see that the specials, great offers boxes are not displaying.

 

Also the shopping cart info is missing from its box as well.

 

Can anyone give me any ideas on why it only happens on this page, because it has got me stumped!

 

Thanks

 

Mark


Lifes a bitch, then you marry one, then you die!

Share this post


Link to post
Share on other sites

Hi. Great contribution. But when I installed the new beta version, my pop-ups stopped working. At the moment, they just show my almost entirely empty template. How do I fix this? A previous poster mentioned that her pop-up problems were fixed with an address change in the product_info.php page, but I can't seem to find what to change. Help would be greatly appreciated.


Always BACK UP your files and your database before making any changes. Before asking questions, check out the Knowledge Base. Check out the contributions to see if your problem's solved there. Search the forums.

 

Useful threads: Store Speed Optimization How to make a horrible shop Basics for design change How to search the forums

 

Useful contributions: Easypopulate Fast, Easy Checkout Header Tag Controller

Share this post


Link to post
Share on other sites

I should have mentioned that I'm not using the product_info template, just the basic sts template. And it still happens when I remove the sts_product_info page from the server.


Always BACK UP your files and your database before making any changes. Before asking questions, check out the Knowledge Base. Check out the contributions to see if your problem's solved there. Search the forums.

 

Useful threads: Store Speed Optimization How to make a horrible shop Basics for design change How to search the forums

 

Useful contributions: Easypopulate Fast, Easy Checkout Header Tag Controller

Share this post


Link to post
Share on other sites
I should have mentioned that I'm not using the product_info template, just the basic sts template.  And it still happens when I remove the sts_product_info page from the server.

Same for me.

Share this post


Link to post
Share on other sites
and how can you disable that part of sts?

 

Not really a matter of disabling it so much... Just don't do this and it will use the osC stock product_info.

 

PRODUCT_INFO TEMPLATES: You can customize your product information pages by

creating /catalog/includes/sts_templates/product_info.php.html and using the

product_info template variables (listed below) to layout your product_info

pages.

 

Iggy


Everything's funny but nothing's a joke...

Share this post


Link to post
Share on other sites
Not really a matter of disabling it so much... Just don't do this and it will use the osC stock product_info.

Iggy

 

well i still dont know what you mean and what i must do...

i want to disable the product info template..

i want to have it all in one file of the sts template system

do you know how to do that?

Share this post


Link to post
Share on other sites

k this is the problem

for the points system i need to ad this to the product info page:

 

<!-- Points/Rewards Module V1.50 show_points_info bof -->

<?php

if ((USE_POINTS_SYSTEM == 'true') && (DISPLAY_POINTS_INFO == 'true')) { // check that the points system is enabled

if ($new_price = tep_get_products_special_price($product_info['products_id'])) {

$products_price_points = tep_display_points($new_price, tep_get_tax_rate($product_info['products_tax_class_id'])) . '</span>';

} else {

$products_price_points = tep_display_points($product_info['products_price'], tep_get_tax_rate($product_info['products_tax_class_id']));

}

$products_points = tep_calc_products_price_points($products_price_points);

$products_points_value = tep_calc_price_pvalue($products_points);

if (USE_POINTS_FOR_SPECIALS == 'true' || $new_price == false){

?>

<p><?php echo sprintf(TEXT_PRODUCT_POINTS , $products_points) .TEXT_PRODUCT_POINTS_VALUE . $currencies->format($products_points_value); ?></p>

<?php

} else {

?>

<p><?php echo TEXT_PRODUCT_NO_POINTS; ?></p>

<?php

}

}// else do not show points_value

?>

<!-- Points/Rewards Module V1.50 show_points_info eof -->

 

but when i ad that code, STS give me this error on the products info page:

Fatal error: Call to undefined function: tep_display_points() in /home/httpd/vhosts/domain.nl/httpdocs/product_info.php on line 151

Edited by suikert

Share this post


Link to post
Share on other sites
well i still dont know what you mean and what i must do...

i want to disable the product info template..

Do you have a product_info.php.html in /catalog/includes/sts_templates/? If you do then delete it and make your changes to /catalog/product_info.php instead.

 

i want to have it all in one file of the sts template system

do you know how to do that?

 

That I wouldn't know how to do.

 

Iggy


Everything's funny but nothing's a joke...

Share this post


Link to post
Share on other sites
Do you have a product_info.php.html in /catalog/includes/sts_templates/? If you do then delete it and make your changes to /catalog/product_info.php instead.

That I wouldn't know how to do.

 

Iggy

 

thanks that helped!!!

 

another thing, my popup for the extra images is not working anymore,

can you alsow help me with that?

Share this post


Link to post
Share on other sites
thanks that helped!!!

 

another thing, my popup for the extra images is not working anymore,

can you alsow help me with that?

 

All the changes you made to the STS product_info will have to be made to the osC product_info

 

Iggy


Everything's funny but nothing's a joke...

Share this post


Link to post
Share on other sites

I've installed version 3 so that I could have different templates for each of the product categories and it works like a dream.

 

But I have a problem. I use the page editor contribution and I need to be able to have a different templae for each page... this used to work in the old STS version.

 

The URLs look like this "pages.php?page=story1" and in the old version I could call the template like this "pages.php_story1.html" and it worked. But in this new version, STS is calling the default template for these pages.

 

Any idea what the problem is?

 

Thanks!

Share this post


Link to post
Share on other sites

I am still at a loss as to why my "click to enlarge" is not working. I have tried just using the sts_template.html file and still get the same thing. I looked at the output source code and used the link to enlarge it and it works. It has to be some sort of java error. check it out

Share this post


Link to post
Share on other sites

Hello.

 

I've installed the mod and everything is working great. I would like to add a tag for a full size image instead of a small image with a click to enlarge link.

 

I would also like to use the xsell mod, but don't see away to add it to the product page. Is there a way/tag to do this?


Thanks!

Clesha

Share this post


Link to post
Share on other sites

Well I figured out how to solve my problem with the products on the main page but now I have a new issue. I created a custom product html page, and when I click on checkout it goes right back to my opening page with no checkout info. now I assume this is because the shopping carts uses $content to handle all of the checkout stuff. If that is the case I am probably goin to have alot of work ahead of me because I don't use $content anywhere on my site (can't integrate it even close to how I want the page to look)...now I am assuming I am going to have to custom edit every checkout procedure page? Just making sure I don't go through all the work to find out there was an easier solution.

Share this post


Link to post
Share on other sites

Well, when I turn off javascript, the click to enlarge works properly. Turning off STS results in the click to enlarge being sent to the exact same address (since I was wondering if I might have missed a problem in Ultimate SEO URLs), but it works properly. It's very strange.


Always BACK UP your files and your database before making any changes. Before asking questions, check out the Knowledge Base. Check out the contributions to see if your problem's solved there. Search the forums.

 

Useful threads: Store Speed Optimization How to make a horrible shop Basics for design change How to search the forums

 

Useful contributions: Easypopulate Fast, Easy Checkout Header Tag Controller

Share this post


Link to post
Share on other sites

add this on your sts_templates after body tag

 

<script language="javascript"><!--

function popupWindow(url) {

url = url

window.open(url,'popupWindow','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,res

izable=yes,copyhistory=no,width=100,height=100,screenX=150,screenY=150,top=150,le

ft=150')

}

//--></script>


Hey its free!

Share this post


Link to post
Share on other sites

That doesn't seem to fix it, I'm afraid.


Always BACK UP your files and your database before making any changes. Before asking questions, check out the Knowledge Base. Check out the contributions to see if your problem's solved there. Search the forums.

 

Useful threads: Store Speed Optimization How to make a horrible shop Basics for design change How to search the forums

 

Useful contributions: Easypopulate Fast, Easy Checkout Header Tag Controller

Share this post


Link to post
Share on other sites
add this on your sts_templates after body tag

 

<script language="javascript"><!--

function popupWindow(url) {

  url = url

  window.open(url,'popupWindow','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,res

izable=yes,copyhistory=no,width=100,height=100,screenX=150,screenY=150,top=150,le

ft=150')

}

//--></script>

Thanks, but that did not work.

Share this post


Link to post
Share on other sites

I just created a workaround by creating an alternate application_top and application_bottom without the STS code, then changing popup_image to call on the alternate versions of application_top and bottom, and it seems to work. I haven't tested it out fully yet, but for a quick workaround, it works fine.


Always BACK UP your files and your database before making any changes. Before asking questions, check out the Knowledge Base. Check out the contributions to see if your problem's solved there. Search the forums.

 

Useful threads: Store Speed Optimization How to make a horrible shop Basics for design change How to search the forums

 

Useful contributions: Easypopulate Fast, Easy Checkout Header Tag Controller

Share this post


Link to post
Share on other sites

function popupWindow(url) {
 window.open(url,'popupWindow','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,res
izable=yes,copyhistory=no,width=100,height=100,screenX=150,screenY=150,top=150,le
ft=150')
}

var selected;
var submitter = null;
function submitFunction() {
  submitter = 1;
  }
function selectRowEffect(object, buttonSelect) {
 if (!selected) {
   if (document.getElementById) {
     selected = document.getElementById('defaultSelected');
   } else {
     selected = document.all['defaultSelected'];
   }
 }

 if (selected) selected.className = 'moduleRow';
 object.className = 'moduleRowSelected';
 selected = object;

// one button is not an array
 if (document.checkout_payment.payment[0]) {
   document.checkout_payment.payment[buttonSelect].checked=true;
 } else {
   document.checkout_payment.payment.checked=true;
 }
}

function rowOverEffect(object) {
 if (object.className == 'moduleRow') object.className = 'moduleRowOver';
}

function rowOutEffect(object) {
 if (object.className == 'moduleRowOver') object.className = 'moduleRow';
}

function check_form() {
 var error = 0;
 var error_message = "Errors have occured during the process of your form.\n\nPlease make the following corrections:\n\n";
 var payment_value = null;
 if (document.checkout_payment.payment.length) {
   for (var i=0; i<document.checkout_payment.payment.length; i++) {
     if (document.checkout_payment.payment[i].checked) {
       payment_value = document.checkout_payment.payment[i].value;
     }
   }
 } else if (document.checkout_payment.payment.checked) {
   payment_value = document.checkout_payment.payment.value;
 } else if (document.checkout_payment.payment.value) {
   payment_value = document.checkout_payment.payment.value;
 }

 if (payment_value == "cc") {
   var cc_owner = document.checkout_payment.cc_owner.value;
   var cc_number = document.checkout_payment.cc_number.value;
   var cvvnumber = document.checkout_payment.cvvnumber.value;
   if (cc_owner == "" || cc_owner.length < 3) {
     error_message = error_message + "* The owner's name of the credit card must be at least 3 characters.\n";
     error = 1;
   }
   if (cc_number == "" || cc_number.length < 10) {
     error_message = error_message + "* The credit card number must be at least 10 characters.\n";
     error = 1;
   }
   if (cvvnumber.length > 4) {
     error_message = error_message + "*** The credit card validation number must be 4 digits or less. \n";
     error = 1;
   }
   if (cvvnumber == ""|| cvvnumber.length < 3) {
     error_message = error_message + "*** The credit card validation number must be at least 3 digits . \n";
     error = 1;
   }
 }

 if (payment_value == null && submitter != 1) {
   error_message = error_message + "* Please select a payment method for your order.\n";
   error = 1;
 }

 if (error == 1 && submitter != 1) {
   alert(error_message);
   return false;
 } else {
   return true;
 }
}

function couponpopupWindow(url) {
 window.open(url,'popupWindow','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,re
sizable=yes,copyhistory=no,width=450,height=280,screenX=150,screenY=150,top=150,l
eft=150')
}

I entered the code that was located in mysite into the actual sts_template.html and then saved it and voilla no problem.

Share this post


Link to post
Share on other sites

ok,

 

so what actually works. It seems that non of my js actually work, nothing not even the pop-up that should come up when you get errors when creating an account, like for if u forget to enter something...

 

whats the best thing to do????


Don't die with the music in you!!!

 

Failure is just another boundary to sucess!!! But that doesn't mean your getting somewhere...

Share this post


Link to post
Share on other sites

ok got this working,

 

turns out you need the <!-- $headcontent --> in your template which i didnt have.

 

anyone,

 

does anyone know what would cause the pages to all have js errors on the page. i got the popups etc to work but it still has js errors.

 

any ideas?


Don't die with the music in you!!!

 

Failure is just another boundary to sucess!!! But that doesn't mean your getting somewhere...

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×