Display Current Price Above Cart Options

Questions and answers about ShopSite Custom Templates

Display Current Price Above Cart Options

Postby inhouse » Wed Jul 27, 2011 8:48 am

Hi, I would like to display the current product prices above my shopping cart but I can't figure out how to do so. I tried adding this include to my custom template above my product but all I see is the word "Price".

Code: Select all
[-- STORE.Price --]


Technically I have 2 products "Regular" and "Winter Mix" that are available in a drop down menu. Can I display both these prices above the cart options?
<option value="Choose A Product;n">Choose A Product
<option value="Regular ($3.37)">Regular ($3.37)
<option value="Winter Mix ($3.80);+0.43">Winter Mix ($3.80)

So it would look something like this (with CSS styling of course).

Current Prices<br>
Regular: $3.37<br>
Winter Mix: $3.80

Thanks for any help.
inhouse
 
Posts: 27
Joined: Wed Jul 13, 2011 6:27 am

Re: Display Current Price Above Cart Options

Postby Jim » Wed Jul 27, 2011 9:11 am

I'm not clear on what you are asking.
When you say "display the current product prices above my shopping cart" are you talking about on the store pages or the Shopping cart itself? It would not be possible on the shopping cart itself but could be done on store pages.

To list both the "Current Prices" text and the products with their prices then you could do a loop products using a special product template that only displays the name and price.

in your page template where you want the output you would put

Current Prices:<br>
[-- loop products --]
[-- product details --]<br>
[-- end_loop products --]

then you would create a product template called "details" that contains

[-- define product --]
[-- product.name --]: [-- product.price --]
[-- end_define product --]

When you publish the store the text "Current Prices:" will be displayed with a list of all the products and their prices below it like this from my test store.

Current Prices:
!test: $33.00
!Zebra Combo Mats: $10.00
Jim
Site Admin
 
Posts: 4953
Joined: Fri Aug 04, 2006 1:42 pm
Location: Utah

Re: Display Current Price Above Cart Options

Postby inhouse » Wed Jul 27, 2011 9:59 am

Jim, thanks a lot, that worked perfectly. You can see the result here: http://protech.accountsupport.com/store/

I realize that "Winter Mix" is actually not a secondary product at all, but an option that increases the price. Is there any way to display that price in the Current Price list I just created?

I'd really like to specify "Regular" and "Winter Mix" as the 2 product prices.
Current Prices
Regular: $3.37
Winter Mix: $3.80

Currently it shows up as "Home Heating Oil" which is the generic phrase encompassing both products.

Edit: In other words, display the drop down options mentioned above "Regular" and "Winter Mix". These display the true current prices. Thanks again.
inhouse
 
Posts: 27
Joined: Wed Jul 13, 2011 6:27 am

Re: Display Current Price Above Cart Options

Postby Jim » Wed Jul 27, 2011 12:49 pm

I don't believe that would be practical to do. The option modifier (;+0.43) is handled by the code in the shopping cart and does not affect what displays on the store pages. The reason you see the correct price on the store page is because it is hard coded into the option text
Regular ($3.37)
Winter Mix ($3.80);+0.43

So if you change the base price for the oil to 3.50 unless you change the text part of the option [Regular (3.37)] the price the shopper sees in the cart will not match the price they see on the store page. The winter mix will still have a price increase of 0.43 above the new price because that offset is calculated by the cart. In the cart Regular would be 3.50 not 3.37 and Winter mix will be 3.93 not 3.80 if you change the base price.

There is a template tag that will give you just the options with the price modifiers [-- PRODUCT.OptionFiniteText --] but you would have to create a program to process that information and return it to your store page in the format you want.
With these options defined
Regular
Winter Mix;+0.43
the tag outputs
Regular Winter Mix;+0.43

You would have to pass that output to your CALL program along with the product price. The program would have to strip the options and the modifiers and calculate the price for each and return that properly formatted. The format for the CALL would be something like this [-- CALL yourprogram (product.price, product.optionfinitetext ) --] . I'm not a programmer so I don't know how you would go about extracting the price, and each option and then modifying them to return properly formatted.

It would be much easier if you have 2 separate products and not try to combine them using order options.
Jim
Site Admin
 
Posts: 4953
Joined: Fri Aug 04, 2006 1:42 pm
Location: Utah

Re: Display Current Price Above Cart Options

Postby inhouse » Tue Aug 09, 2011 11:06 am

Hi Jim,

I have added a subproduct to my main product which is now showing up under my "current price" at the top of my page. The code you gave me calls to "loop products". How can I call to one product specifically instead so only "Home Heating Oil" price is displayed and no others?

Code: Select all
<div class="current-price">
<div class="current-price-head">Current Heating Oil Price:</div><br>
[-- loop products --]
[-- product details --]<br>
[-- end_loop products --]</div>
inhouse
 
Posts: 27
Joined: Wed Jul 13, 2011 6:27 am

Re: Display Current Price Above Cart Options

Postby inhouse » Tue Aug 09, 2011 12:40 pm

I stumbled upon the solution. I was advised by Lauren to add the subproduct to the page by creating a custom template for it. I then detached the subproduct from the page and incidentally the only price shown on the page is the main product. Beautiful! About time I got lucky. Thanks anyways.

http://www.shopsite.com/templates/cookbook/product12-subcheckbox.shtml
inhouse
 
Posts: 27
Joined: Wed Jul 13, 2011 6:27 am


Return to Custom Template Questions

Who is online

Users browsing this forum: No registered users and 79 guests

cron