| ||||||||||
Shopping cart software Solutions for online shops and malls | ||||||||||
|
X-Cart Home | FAQ | Forum rules | Calendar | User manuals | Login |
Select category for discount pricing | |||
|
|
Thread Tools | Search this Thread |
#1
|
|||||||
|
|||||||
Select category for discount pricing
I have a closeouts (root category) and I need the correct variable to select the root category for my closeouts and display the Market price discount for any product in that category in the product.tpl.
I tried {if $product.price ne 0 && $cat="78"} <font class="MarketPrice">{$lng.lbl_market_price}:{math equation="100-(price/lprice)*100" price=$product.taxed_price lprice=$product.list_price format="%3.0f" assign=discount} <span id="save_percent"><font class="closeoutsdiscount">{ $discount }</span>%</font> What variable would I use for the root category to select in my product.tpl?
__________________
______________ version 4.1.9 Gold |
|||||||
#2
|
|||||||||
|
|||||||||
Re: Select category for discount pricing
sorry, I don't understand what you're trying to do?
only display the market price if it's in the closeouts category? but display it in the other categories?
__________________
X-Cart version 5 (Previously 3.5-4) Previous Versions included BCSE Reward Points Mod Altered Cart On Sale Mod Wordpress Plugin Please don't PM me for support. I help where I can on the forum and your question will more likely be answered there. Shout me a Coffee! |
|||||||||
#3
|
|||||||
|
|||||||
Re: Select category for discount pricing
The first part of your answer is desired... to only display the market price for the closeouts category. Currently I do not use a discount price and have only membership levels for each product. For this, I do not apply a list price, and the market price is just a dummy price that doesn't show on our products.
__________________
______________ version 4.1.9 Gold |
|||||||
#4
|
|||||||||
|
|||||||||
Re: Select category for discount pricing
OK, so you want a different price display for your closeouts category than the rest. OK
you tried this: Code:
and it didn't work. It looks about right to me, but you haven't got and end if Code:
I take it you have used webmaster mode to check the value of $cat for your closeouts category?
__________________
X-Cart version 5 (Previously 3.5-4) Previous Versions included BCSE Reward Points Mod Altered Cart On Sale Mod Wordpress Plugin Please don't PM me for support. I help where I can on the forum and your question will more likely be answered there. Shout me a Coffee! |
|||||||||
#5
|
|||||||
|
|||||||
Re: Select category for discount pricing
Yes, I have used webmaster mode and I also checked in the cpanel to make sure of the correct placement value. The end if was proper in my product.tpl, though I did not select all the lines for copy/paste here. I also tried {if $product.price ne 0 && $cat eq "78"} and {if $product.price ne 0 && $category.categoryid eq "78"}, but still no cigar.
__________________
______________ version 4.1.9 Gold |
|||||||
#6
|
|||||||||
|
|||||||||
Re: Select category for discount pricing
have you tried just
Code:
just to isolate the issue?
__________________
X-Cart version 5 (Previously 3.5-4) Previous Versions included BCSE Reward Points Mod Altered Cart On Sale Mod Wordpress Plugin Please don't PM me for support. I help where I can on the forum and your question will more likely be answered there. Shout me a Coffee! |
|||||||||
#7
|
|||||||
|
|||||||
Re: Select category for discount pricing
I've tried to isolate the category, but using $cat eq '78' doesn't display the market price.
{if $cat eq '78'} <font class="MarketPrice">{$lng.lbl_market_price}:{math equation="100-(price/lprice)*100" price=$product.taxed_price lprice=$product.list_price format="%3.0f" assign=discount} <span id="save_percent"><font class="closeoutsdiscount">{ $discount }</span>%</font> {/if} Is it missing something else like a {foreach from=$categories or {if $main... I'll try any suggestions.
__________________
______________ version 4.1.9 Gold |
|||||||
#8
|
|||||||||
|
|||||||||
Re: Select category for discount pricing
Hi Christine,
When you say "root category" do you mean another category you have put the product in that is not defined as the main category? Check the breadcrumb on the product page - those are the categories that you defined as the main category for the product. If you do not see the closeout category in that path - I do not believe the default queries for product.php capture that category. (In other words - a product can be in multi categories and for some shops, a query to capture all the category information for every product page load could be a lot of extra overhead, if it were not used.) You may want to take a look at the $current_category array, you will see the categories XCART has about your product: $current_category.categoryid, $current_category.parentid, etc. I think the category_location array is also there that is used to make the breadcrumb. If you don't see your closeout category - you may have to add a query to product.php to check to see if a product is in that category - and then set a flag you can use in the template.
__________________
X-CART (4.1.9,12/4.2.2-3/4.3.1-2/4.4.1-5)-Gold (CDSEO, Altered-Cart On Sale, BCSE Preorder Backorder, QuickOrder, X-Payments, BCSE DPM Module) |
|||||||||
#9
|
|||||||||
|
|||||||||
Re: Select category for discount pricing
how about
Code:
__________________
X-Cart version 5 (Previously 3.5-4) Previous Versions included BCSE Reward Points Mod Altered Cart On Sale Mod Wordpress Plugin Please don't PM me for support. I help where I can on the forum and your question will more likely be answered there. Shout me a Coffee! |
|||||||||
|
#10
|
|||||||
|
|||||||
Re: Select category for discount pricing
Thanks for your help. Still no cigar with trying to use the root category. I have a work-around now with using an extra field, this isn't the best solution, but I've tried many combination's for the root category and can't get it to work.
__________________
______________ version 4.1.9 Gold |
|||||||
|
|||
X-Cart forums © 2001-2020
|