| ||||||||||
![]() |
Shopping cart software Solutions for online shops and malls | |||||||||
![]() |
![]() |
|
X-Cart Home | ![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
Quick code snippet please :) | ||||
![]() |
|
|
Thread Tools | Search this Thread |
#1
|
|||||||
|
|||||||
![]() I need to put a line of text on the first checkout page, but ONLY if the customer has a certain product in their cart.
Would someone please give me a quick code snippet (I could take it from there)? VERY ROUGH EXAMPLE: {if product number 10 is in this cart} Show this Text {else} {/if} Thanks! :Stacey
__________________
version 4.0.18 (+ several cool mods) |
|||||||
#2
|
|||||||||
|
|||||||||
![]() Code:
![]() ![]() |
|||||||||
#3
|
|||||||
|
|||||||
![]() Didn't work right off, but it does give me a starting point
![]() Thanks for the lead! :Stacey
__________________
version 4.0.18 (+ several cool mods) |
|||||||
#4
|
|||||||||
|
|||||||||
![]() Depends a lot on what mode you're using (standard checkout or anonymous checkout).
To save changing more than 1 section of code, a good place to put this code is in cart_details.tpl (skin1/customer/main/cart_details.tpl}. Look for the section of code like this Code:
Just before the {/section} add these lines Code:
Depeding on how you've based your products, you may have to change productid to productcode. You can change the message appearance to whatver you want with CSS or font ..oh!, can also change the message! LeeD
__________________
Why a mouse when it spins ...... X-Cart Gunslingers - For Hire!! http://forum.x-cart.com/viewtopic.php?t=8615 |
|||||||||
#5
|
|||||||
|
|||||||
![]() Is it possible to do the same thing based on category or subcategory id instead of product id.
I have tried just about every possible option based on the example posted earlier and can't seem to get it to work...it only works if use product ID. Here is what I have tried thus far Code:
|
|||||||
#6
|
|||||||||
|
|||||||||
![]() try
Code:
__________________
Looking for a reliable X-cart host ? You wont go wrong with either of these. ![]() ![]() |
|||||||||
#7
|
|||||||
|
|||||||
![]() Did not work either. I am a newbie so please excuse my ignorance..
Is it possible that the category varibles are not avail in the cart_details.tpl? |
|||||||
#8
|
|||||||||
|
|||||||||
![]() read this post to see how to see what variables are available on each page
http://forum.x-cart.com/viewtopic.php?t=14481&highlight=debug
__________________
Looking for a reliable X-cart host ? You wont go wrong with either of these. ![]() ![]() |
|||||||||
#9
|
|||||||
|
|||||||
![]() Thanks Shan,
Im running the debug console now... I noticed earlier that if I looked for a a cat id=0 it would work... Running debug - and reviewing the varibles - I found one that may work ( categoryid => 95) ...but Im not sure how to check for it... $products Array (1) 0 => Array (63) cartid => 1 productid => 223 amount => 1 options => Array (0) free_price => 0.00 productcode => Vendo 63 Instant Download Vers product => Vendo 63 Service Manual Instant Downl... distribution => /downloads/Vendo-63-90-126-SM.pdf vat => 0 product_type => N price => 10.95 options_surcharge => 0.00 product_options => empty discount => 0 coupon_discount => 0 discounted_price => 10.95 subtotal => 10.95 provider => master brand => empty model => empty weight => 0.00 categoryid => 95 |
|||||||
#10
|
|||||||||
|
|||||||||
![]() {$products[num].categoryid}
something like that you have to reference it from the section (loop) its in
__________________
Looking for a reliable X-cart host ? You wont go wrong with either of these. ![]() ![]() |
|||||||||
|
|||
X-Cart forums © 2001-2020
|