Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Special price on product info page not showing


sumdexusa

Recommended Posts

Hello,

 

I'm having a problem on my product info page. If I set a special price for a product, on the product list page, it properly displays the old price struck-out and next to it the sale price. But on the product info page, it still shows the regular price next to the ADD TO CART button with no mention of the special price. I would like it to show the special price only. Or at the very least, no price at all and I will show the special price somewhere else.

 

After some research, here is what I have in my sts_inc/product_info.php file in the price display section:

 

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

$template_pinfo['regularpricestrike'] = "<s>" . $template_pinfo['regularprice'] . "</s>";

$template_pinfo['specialprice'] = $currencies->display_price($new_price, tep_get_tax_rate($product_info['products_tax_class_id']));

} else {

$template_pinfo['specialprice'] = '';

$template_pinfo['regularpricestrike'] = $template_pinfo['regularprice'];

 

Is anything there causing the problem? Or is there anything there I can do to just not show the price at all? Any help would be appreciated. Thanks in advance!

Edited by sumdexusa
Link to comment
Share on other sites

Well, I haven't figured this out, but I think in the meantime, I've managed to do this next best thing to either having the special price or not having the regular price there. I made the regular price have a strikeout through it! Not pretty, but it'll work.

 

If anyone can still provide some direction on having the special price appear instead of the regular price, I'd appreciate it. Thank you!

Link to comment
Share on other sites

In file product_info.php, you can find this code

    if ($new_price = tep_get_products_special_price($product_info['products_id'])) {
     $products_price = '<s>' . $currencies->display_price($product_info['products_price'], tep_get_tax_rate($product_info['products_tax_class_id'])) . '</s> <span class="productSpecialPrice">' . $currencies->display_price($new_price, tep_get_tax_rate($product_info['products_tax_class_id'])) . '</span>';
   } else {
     $products_price = $currencies->display_price($product_info['products_price'], tep_get_tax_rate($product_info['products_tax_class_id']));
   }

This says that

IF there is a special price then the price = regular price striked out (within the <s></s> tags) + the special price (within the <span></span> tags)

ELSE price = just the regular price

 

Later on the $products_price is getting echoed

 <td class="pageHeading" align="right" valign="top"><?php echo $products_price; ?></td>

 

Do you have this or similar lines in tour file? How do they look like?

Link to comment
Share on other sites

Hello Multimixer, thanks very much for your assistance!

 

Are you referring to the product_info.php file in the catalog folder? If so, here is what it says for that price section:

 

    if ($new_price = tep_get_products_special_price($product_info['products_id'])) {
     $products_price = '<s>' . $currencies->display_price($product_info['products_price'], tep_get_tax_rate($product_info['products_tax_class_id'])) . '</s> <span class="productSpecialPrice">' . $currencies->display_price($new_price, tep_get_tax_rate($product_info['products_tax_class_id'])) . '</span>';
   } else {
     $products_price = $currencies->display_price($product_info['products_price'], tep_get_tax_rate($product_info['products_tax_class_id']));
   }

 

And later on, this is what I have for that echo line:

 

<td class="pageHeading" align="right" valign="top"><?php echo $products_price; ?></td>

 

If you are referring to the product_info.php file in the catalog/includes/modules/sts_inc folder, I quoted that on my original post. Do you see anything wrong with either of these?

Edited by sumdexusa
Link to comment
Share on other sites

oops, I'm sorry, somehow I didn't notice that you talk about sts, by brain was flying :)

 

The code looks ok (=standard), I think the problem is that you don't use the $specialprice$ tag in you content product_info.php.html template

 

You need to use them both together, like $regularpricestrike$$specialprice$ in order to have this effect you want

Link to comment
Share on other sites

You. Are. AWESOME!

 

That was it. Though I had to make a modification, in case this helps anyone out in a similar situation.

 

First, I did't even know to look in the sts-template/content folder for the html file. After that, when I used the $regularpricestrike$$specialprice$ tag combo, for some reason, I was getting exactly that (for example: $259.99$$150.00$). Instead, I just used $regularpricestrike$specialprice tag and that worked. Not sure why as I have read other instances of people using the $specialprice$ tag, but the single $ worked for me.

 

Thanks again for taking the time to help me. Really appreciate it!

Edited by sumdexusa
Link to comment
Share on other sites

Not sure why as I have read other instances of people using the $specialprice$ tag, but the single $ worked for me.

 

This comes because you didn't define $ to be the endchar of your tags in your templates

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...