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

Variants on the Productlist

 
Reply
   X-Cart forums > X-Cart 4 > Dev Questions
 
Thread Tools Search this Thread
  #1  
Old 12-13-2007, 06:37 AM
 
Jonjolt1 Jonjolt1 is offline
 

Advanced Member
  
Join Date: Nov 2006
Posts: 49
 

Default Variants on the Productlist

I think some people will appreciate this, cost me around $260 but I thought I'd share it.

Don't use the Patch file, follow the install instructions and review the report .html file.
Attached Files
File Type: zip variantmod.zip (69.2 KB, 328 views)
__________________
4.1.9
Reply With Quote
  #2  
Old 12-14-2007, 05:45 AM
 
Jonjolt1 Jonjolt1 is offline
 

Advanced Member
  
Join Date: Nov 2006
Posts: 49
 

Default Re: Variants on the Productlist

Anyone got it working yet?
__________________
4.1.9
Reply With Quote
  #3  
Old 12-15-2007, 11:26 AM
 
freelancer_gd freelancer_gd is offline
 

Newbie
  
Join Date: Jan 2007
Posts: 7
 

Default Re: Variants on the Productlist

any examples ?
__________________
Xcart 4.1.6 / Gold Edition /Flexy/Xaom/Xcomp/Xrma/
Reply With Quote
  #4  
Old 12-15-2007, 03:24 PM
 
Jonjolt1 Jonjolt1 is offline
 

Advanced Member
  
Join Date: Nov 2006
Posts: 49
 

Default Re: Variants on the Productlist

http://pleasantsmoke.com/home.php?cat=266
__________________
4.1.9
Reply With Quote
  #5  
Old 12-26-2007, 05:46 PM
 
typologist typologist is offline
 

Advanced Member
  
Join Date: Jul 2007
Posts: 51
 

Default Re: Variants on the Productlist

Does it do what I think? Does it show the variants and allows to add to cart FROM the CATEGORY PAGE? If this is the case, i will give u a kiss!
__________________
4.1.8 Gold (Unix)
Reply With Quote
  #6  
Old 12-26-2007, 06:27 PM
 
typologist typologist is offline
 

Advanced Member
  
Join Date: Jul 2007
Posts: 51
 

Default Re: Variants on the Productlist

Wow!! I installed and its awesome!

Notes: In order for this to work, you must have these options in admin:

- Display products list in multiple columns (1-3) 0
- Enable "Buy Now" button in the products list: Checked

Observations:
It makes your category pages load way slower (obvious!).

Wishlist:
1. I would love to have drop down menus with variants, instead of radio buttons, since they make the customer scroll a lot if you have many of them.
2. I would like to assign a special category, like "Buy fast" and list all products there, and use this mod only in that category.
3. It would be great that it would work if you have 3 or 2 columns format in your categories pages.

THANKS FOR SHARING! I owe u a kiss, lol.
__________________
4.1.8 Gold (Unix)
Reply With Quote
  #7  
Old 12-28-2007, 05:49 AM
 
Jonjolt1 Jonjolt1 is offline
 

Advanced Member
  
Join Date: Nov 2006
Posts: 49
 

Default Re: Variants on the Productlist

About loading slower, for some reason it was working fast with me then it slowed down. I think it might have to do with the template cache maybe. There is room for optimization but I havn't gotten to that stage so far.

Also the original design had a dropdown list but I had them change it to radio buttons. It code be reverted back with a few template changes.
__________________
4.1.9
Reply With Quote
  #8  
Old 01-17-2008, 07:28 AM
 
Freakmode Freakmode is offline
 

X-Adept
  
Join Date: Jun 2003
Location: UK
Posts: 696
 

Default Re: Variants on the Productlist

Has anyone got an example of this working I could see?

Also anyone got any further getting it to work on a 2 column product layout (that would be fantastic)
__________________
X-Cart 4.7.12 (Live)
Redux Template
CDSEO
Reply With Quote
  #9  
Old 02-05-2008, 02:34 PM
  2coolbaby's Avatar 
2coolbaby 2coolbaby is offline
 

eXpert
  
Join Date: Sep 2004
Location: TN moving to FL
Posts: 265
 

Default Re: Variants on the Productlist

Question. The patch.diff shows this:

Quote:
Index: modules/Product_Options/customer_options.php
================================================== =================
diff -u modules/Product_Options/customer_options.php
--- modules/Product_Options/customer_options.php
+++ modules/Product_Options/customer_options.php
@@ -65,6 +65,7 @@ if (!empty($product_options) && !empty($

}

+if (!$dont_assign) {
if (!empty($product_options))
$smarty->assign("product_options",$product_options);

My customer_options.php file looks like this:

Quote:
if (!empty($product_options) && !empty($options) && is_array($options)) {


# Defined preselected options
foreach ($product_options as $k => $v) {
if (preg_match("/^\d+$/S", $options[$v['classid']])) {
if ($v['is_modifier'] == 'T') {
$product_options[$k]['default'] = $options[$v['classid']];
} else {
$product_options[$k]['options'][$options[$v['classid']]]['selected'] = 'Y';
}
} else {
$product_options[$k]['default'] = $options[$v['classid']];
}
}

}
Would I put the code after this line?:
Quote:
if (!empty($product_options) && !empty($options) && is_array($options)) {
__________________
Mary Lee
-------------------
Dinner and a Murder Mystery Games
http://www.dinnerandamurder.com

x-cart version 4.7.5 / Mac OS 10.10.5 and Windows 8/10 sometimes - Ideal Responsive Template
Reply With Quote
  #10  
Old 02-06-2008, 09:58 AM
 
intel352 intel352 is offline
 

X-Wizard
  
Join Date: Dec 2005
Posts: 1,071
 

Default Re: Variants on the Productlist

@2coolbaby: is that your entire file?


@Jonjolt1: the speed is likely due to the queries involved. X-Cart has to run at *least* 1 additional query per product for the product options, but likely more than 1 additional. So I'd bet you're essentially doubling/tripling your queries on your category page.
__________________
-Jon Langevin
WARNING: Unethical developer - NOT RECOMMENDED
See details here
Reply With Quote
Reply
   X-Cart forums > X-Cart 4 > Dev Questions



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 06:01 AM.

   

 
X-Cart forums © 2001-2020