X-Cart: shopping cart software

X-Cart forums (https://forum.x-cart.com/index.php)
-   Changing design (https://forum.x-cart.com/forumdisplay.php?f=51)
-   -   Want to include price in 2 places on product.tpl page... (https://forum.x-cart.com/showthread.php?t=12266)

jkirkpatrick 02-18-2005 10:38 AM

Want to include price in 2 places on product.tpl page...
 
Hello,

Several of the items I sell have different variations which affect the price. To help customers make their choices I'd like to include the price closer to the "Add to Cart" button at the bottom of the screen. I have been able to add the base price but when different options are selected only the price at the top of the page changes.

For an example see:
http://www.pipsqueakboutique.com/product.php?productid=16138&cat=258&page=1

You'll notice that the base price of $17 changes for the top price, but not the second one.

Thanks,
Jennifer

balinor 02-18-2005 12:12 PM

Make sure you copy the WHOLE price blurb of code, and not just the actual price portion. There is code in there that ties in to the product options.

jkirkpatrick 02-18-2005 04:14 PM

The code that I copied and pasted is:

Code:

{if $product.taxed_price ne 0 || $variants ne ''}
<FONT class="ProductDetailsTitle"><SPAN id="product_price">{include file="currency.tpl" value=$product.taxed_price}</SPAN></FONT>
<FONT class="MarketPrice"> <SPAN id="product_alt_price">{include file="customer/main/alter_currency_value.tpl" alter_currency_value=$product.taxed_price}</SPAN></FONT>
{if $product.taxes}
{include file="customer/main/taxed_price.tpl" taxes=$product.taxes}{/if}
{else}
<INPUT type="text" size="7" name="price">
{/if}


There's nothing else around it related to pricing. Above is the title and below it starts with the upselling module.

Any idea what I'm missing?

Thanks,
Jennifer

DanUK 06-22-2005 07:24 AM

Hi, just an update on this as I notice you never got it working (looking at your site). I was in the same situation but got X-cart to help me. From another posting I made today:

OK, got X-cart to help me with this.

in customer/main/product.tpl change the second instance of the price to use a separate span tag, in this case product_price2:

Code:

{$lng.lbl_price}: <font class=ProductDetailsTitle><SPAN id="product_price2">{include file="currency.tpl" value=$product.price}</span>


and in /modules/Product_Options/check_options.tpl add this:

Code:

// Update price2
        if(document.getElementById('product_price2'))
                document.getElementById('product_price2').innerHTML = currency_symbol+price_format(price, 2);


underneath // Update price so it looks like this:

Code:

// Update form elements
        // Update price
        if(document.getElementById('product_price'))
                document.getElementById('product_price').innerHTML = currency_symbol+price_format(price, 2);
// Update price2
        if(document.getElementById('product_price2'))
                document.getElementById('product_price2').innerHTML = currency_symbol+price_format(price, 2);


Works for me!

Dan

jkirkpatrick 06-22-2005 07:40 AM

Thank you so much Dan, worked perfectly! :D

I sent 2 messages to the X-Cart team about how to do this, or for a price to have them do it, and both of them were deleted with no response. I'm glad you were able to get an answer from them. Thank you very much for sharing it!

All the Best,
Jennifer


All times are GMT -8. The time now is 10:16 AM.

Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.