| ||||||||||
![]() |
Shopping cart software Solutions for online shops and malls | |||||||||
![]() |
![]() |
|
X-Cart Home | ![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
Detect that session is viewing the Shopping Cart in home.tpl | |||
![]() |
|
|
Thread Tools | Search this Thread |
#1
|
|||||||
|
|||||||
![]() I can tell if I am on a Category page by using this in home.tpl:
{if $meta_page_type eq 'C'...}{/if} The same goes for a product page (replace 'C' with 'P' above) However, I am unable to figure out how to detect I am on the shopping cart page. It would also be helpful to know how to examine the first item in the shopping cart. Particularly the SKU or the Name. Update: my profile says 4.5.2 but I am working on a client site that is version 4.2.2.
__________________
4.5.2 |
|||||||
#2
|
|||||||||
|
|||||||||
![]() Don't use this. Use $main to determine the page. You can look in home_main.tpl and common_templates.tpl to see different $main values
$main eq "product" for example is product page $main eq "cart" is cart page ....
__________________
Steve Stoyanov CFLSystems.com Web Development |
|||||||||
|
#3
|
|||||||
|
|||||||
![]() Thanks, Steve. That is exactly what I was looking for with the first part of my question.
I am still working on trying to look in the cart to determine the sku or name of the first item for comparison. Probably should have issued 2 separate posts. I am sure with the correct amount of time and persistance, I will stumble across it. However, it would be nice to have a nudge in the right direction... ![]()
__________________
4.5.2 |
|||||||
#4
|
|||||||||
|
|||||||||
![]() Do a foreach loop through products array on cart page
__________________
Steve Stoyanov CFLSystems.com Web Development |
|||||||||
#5
|
|||||||
|
|||||||
![]() I have been looking at this for a little while now and I am not getting it.
In home.tpl, I would like to check if $main = 'cart' or 'checkout' and if so, check the first 3 chars of the name of the first item [0] in the cart(could be the first 3 chars of the SKU which might be better) to see if it matches the string 'SLC'. If it does, I am going to change the css used to render the header and some other features in the home.tpl template. I have this working based on Category and Product, but can't seem to get a handle on the first product in the cart and check values on it. I think I don't understand the scope of $cart. It is a php variable so I don't think I can use it directly in Smarty code. I will put a snippet of my busted code below so you can see the depths of my ignorance. Code:
I don't think I even declared the local variable $item_is_special correctly. UPDATE: (ok, nevermind about the question below. Found the answer here) Also, is there documentation for XCart that shows the structure of the $cart object and $product object? Thanks in advance for your time.
__________________
4.5.2 |
|||||||
#6
|
|||||||||
|
|||||||||
![]() I think you need to get some knowledge on the XC files structure and what loads what first before doing this. Also you can use the debug console to see what is available on each page you load and the structure of the variables - turn it on form admin general settings
__________________
Steve Stoyanov CFLSystems.com Web Development |
|||||||||
![]() |
|
Thread Tools | Search this Thread |
|
|
|
|||
X-Cart forums © 2001-2020
|