Follow us on Twitter X-Cart on Facebook Wiki
Shopping cart software Solutions for online shops and malls
 

Upselling Product Categories

 
Reply
   X-Cart forums > X-Cart 4 > Dev Questions > Changing design
 
Thread Tools Search this Thread
  #1  
Old 01-20-2011, 06:12 AM
  DrQuietus's Avatar 
DrQuietus DrQuietus is offline
 

Advanced Member
  
Join Date: Dec 2005
Posts: 81
 

Default Upselling Product Categories

Is there a way to show the category that an upselling product is in?
__________________
Dave Jones
dave@industrialwebworks.net
Mostly 4.7.2 - 4.7.5
Reply With Quote
  #2  
Old 01-20-2011, 05:14 PM
  gb2world's Avatar 
gb2world gb2world is offline
 

X-Wizard
  
Join Date: May 2006
Location: Austin, TX
Posts: 1,970
 

Default Re: Upselling Product Categories

You can use webmaster mode to see if the root category is available in the array that holds the information for the upselling products. If it is not, then you have to modify the php code with the query for the products to include the category.

In 4.4.x - load the page in question with webmaster mode enabled. In the webmaster mode console, select "Show variables". Look for the array with the upselling products. If the category is there, you can use it. If not - the task becomes more complex to modify the query in the php.

---
__________________
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)
Reply With Quote
  #3  
Old 01-23-2011, 01:03 AM
  DrQuietus's Avatar 
DrQuietus DrQuietus is offline
 

Advanced Member
  
Join Date: Dec 2005
Posts: 81
 

Default Re: Upselling Product Categories

OK, what I have is a table that shows the upselling products, however there are more than one products in each category and I didn't want to list the category names multiple times, just once for all the products in the category.

My solution only works if the sort order and category id's are the same, so that is an issue but is an issue for later. And I don't have that many categories, if I did this would be horribly inefficient.

here is my inelegant solution:

Code:
<table> {section name=cat_num loop=$product_links} {assign var='i' value=$u_product_info[cat_num].categoryid} {foreach from=$categories_menu_list item=c name=categories} {if $c.categoryid eq $i and $i ne $n} <tr> <th colspan="3">{$c.category}</th> </tr> {assign var='n' value=$c.categoryid} {/if} {/foreach} <tr> -----UPSELLING PRODUCTS----- </tr> {/section} </table>

Can anyone think of another way to do this without having to loop through all the categories for each product (the category names are not being called in the $product_links loop, which is why I have the $categories_menu_list). Like gb2world said I probably need to modify the query, and I have no idea how to do that. I would still have the issue of only showing the category name once. I can't send the link, because the store is closed until I get all the content in, once it goes live I can provide the link.
__________________
Dave Jones
dave@industrialwebworks.net
Mostly 4.7.2 - 4.7.5
Reply With Quote
  #4  
Old 01-23-2011, 01:36 AM
  DrQuietus's Avatar 
DrQuietus DrQuietus is offline
 

Advanced Member
  
Join Date: Dec 2005
Posts: 81
 

Default Re: Upselling Product Categories

Slight amendment, to avoid more category loops:

Code:
<table> {section name=cat_num loop=$product_links} {assign var='i' value=$u_product_info[cat_num].categoryid} {if $i ne $n} {foreach from=$categories_menu_list item=c name=categories} {if $c.categoryid eq $i} <tr> <th colspan="3">{$c.category}</th> </tr> {assign var='n' value=$c.categoryid} {/if} {/foreach} {/if} <tr> -----UPSELLING PRODUCTS----- </tr> {/section} </table>
__________________
Dave Jones
dave@industrialwebworks.net
Mostly 4.7.2 - 4.7.5
Reply With Quote
Reply
   X-Cart forums > X-Cart 4 > Dev Questions > Changing design



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -8. The time now is 10:19 PM.

   

 
X-Cart forums © 2001-2020