Zen Cart Logo
Forums / All Other Contributions/Addons / Just another Cross-Sell mod (support thread)

Just another Cross-Sell mod (support thread)

Views: 133,948

Results 1 to 20 of 704
15 Aug 2007, 5:50 PM
#1
yellow1912 avatar

yellow1912

Totally Zenned

Join Date:
Oct 2006
Posts:
5,422
Plugin Contributions:
0

Just another Cross-Sell mod (support thread)

JUST ANOTHER CROSS SELL MOD
Version: aplha 1

Based on Advanced Cross-sell originally coded by Absolute
Link to the original:
http://www.zen-cart.com/index.php?main_page=product_contrib_info&cPath=40_47&products_id=597

Features:

  1. Allow unlimited number of product fields instead of only 5.
  2. Accept product id or model as input value.
  3. Clean up table.
  4. Given a list of n products, the mod will go through and cross-sell EACH pair together.
    IMPORTANT: This is the VERY different from the way the old cross-sell mod work! As a seller, I realize that when I cross-sell A and B I want the customers to see the product B while they are viewing A and VICE VERSA.
    With the old cross-sell and the Advanced Cross-Sell mod I had to add A to B then B to A, which is lots of work.

With this mod, if you give it 3 products: A - B - C, it will cross-sell:
A to B, B to A
A to C, C to A
B to C, C to B

Screenshot:
https://svn.rubikintegration.com/zencart_mods/cross_sell_advanced/screenshot.gif

Bug report:
http://www.rubikintegration.com/mantis
Latest (unstable) version:
https://svn.rubikintegration.com/zencart_mods/cross_sell_advanced/
Latest (stable) version:
link should be available here soon!

yellow1912

15 Aug 2007, 5:54 PM
#2
yellow1912 avatar

yellow1912

Totally Zenned

Join Date:
Oct 2006
Posts:
5,422
Plugin Contributions:
0

Re: Just another Cross-Sell mod (support thread)

Alpha 1
I submitted the mod on the download page but the file was not uploaded _. Hope someone can upload this file there for me!

Regards,

16 Aug 2007, 12:20 PM
#4
paulm avatar

paulm

Totally Zenned

Join Date:
Nov 2003
Posts:
1,878
Plugin Contributions:
5

Re: Just another Cross-Sell mod (support thread)

Sounds very interesting :thumbsup:

I was wondering about this though:

Given a list of n products, the mod will go through and cross-sell EACH pair together.Is this an option? Is it possible to link some products from A to B only and others vice versa?

16 Aug 2007, 2:11 PM
#5
yellow1912 avatar

yellow1912

Totally Zenned

Join Date:
Oct 2006
Posts:
5,422
Plugin Contributions:
0

Re: Just another Cross-Sell mod (support thread)

No, not an option now. But since this mod requires that you must have the old cross-sell installed, you still have access to that one after installing this in case you want to cross a to B only.

I'll add that specific option in the next version.

paulm:

Sounds very interesting :thumbsup:

I was wondering about this though:
Is this an option? Is it possible to link some products from A to B only and others vice versa?

16 Aug 2007, 3:34 PM
#6
paulm avatar

paulm

Totally Zenned

Join Date:
Nov 2003
Posts:
1,878
Plugin Contributions:
5

Re: Just another Cross-Sell mod (support thread)

Ok thanks :-)

(I was thinking about batteries for example, one battery may be x-sold with many products, but it's not logical to x-sell all those products together with the battery)

16 Aug 2007, 4:23 PM
#7
yellow1912 avatar

yellow1912

Totally Zenned

Join Date:
Oct 2006
Posts:
5,422
Plugin Contributions:
0

Re: Just another Cross-Sell mod (support thread)

That's very easy to do, I'll add it to my to-do list and the new version will be ready very soon. Right now my time is running out (school starts next week), so I'm working on another mod (retrieves articles from blogs about a specific product and show to customers)

paulm:

Ok thanks :-)

(I was thinking about batteries for example, one battery may be x-sold with many products, but it's not logical to x-sell all those products together with the battery)

16 Aug 2007, 7:55 PM
#8
yellow1912 avatar

yellow1912

Totally Zenned

Join Date:
Oct 2006
Posts:
5,422
Plugin Contributions:
0

Re: Just another Cross-Sell mod (support thread)

Just a side-note, there is one feature of this mod that I forgot to mention:
When you edit the cross-sell(s) of 1 product, you can change the sort_order or delete cross-sell(s) very easily. This was one of the features missing in Advanced XSell

18 Aug 2007, 4:07 AM
#9
yellow1912 avatar

yellow1912

Totally Zenned

Join Date:
Oct 2006
Posts:
5,422
Plugin Contributions:
0

Re: Just another Cross-Sell mod (support thread)

I made a very stupid mistake which prevents dynamically adding new product fields on certain browsers. I have uploaded alpha 1 (rev 29), please download it when it's available on the download section.

For a quick fix, just open admin/xsell_advanced.php, search for "xsellProducts", you will find 2 results. Change the FIRST one to "xsellCleanup".

18 Aug 2007, 1:37 PM
#10
michaelhl avatar

michaelhl

New Zenner

Join Date:
Oct 2005
Location:
Germany
Posts:
60
Plugin Contributions:
0

Re: Just another Cross-Sell mod (support thread)

Hello,
I install it, and if I want insert a cross sell, I get a SQL-Error like this:

1064 You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ')' at line 1
in:
[SELECT products_id FROM products WHERE products_id = 1175 LIMIT 1 UNION (SELECT products_id FROM products WHERE products_id = 1152 LIMIT 1)]
If you were entering information, press the BACK button in your browser and re-check the information you had entered to be sure you left no blank fields.

18 Aug 2007, 2:10 PM
#11
michaelhl avatar

michaelhl

New Zenner

Join Date:
Oct 2005
Location:
Germany
Posts:
60
Plugin Contributions:
0

Re: Just another Cross-Sell mod (support thread)

Now I install the rev29 files, but all is the same. Also the dynamic input fields dosen't work in IE6.
IE6 shows an error-symbol down on the left side:

Row: 280
Character: 78
Mistake: Bezeichner, Zeichenfolge oder Zahl erwartet
Code:0
URL: xxxxxxxxxxxxx/xxxxxxx/xsell_advanced.php

18 Aug 2007, 3:13 PM
#12
yellow1912 avatar

yellow1912

Totally Zenned

Join Date:
Oct 2006
Posts:
5,422
Plugin Contributions:
0

Re: Just another Cross-Sell mod (support thread)

Huhm, it might be a mysql compatibility issue. What is your mysql version?

About IE6 error, I'm looking into it right now.

18 Aug 2007, 3:22 PM
#13
michaelhl avatar

michaelhl

New Zenner

Join Date:
Oct 2005
Location:
Germany
Posts:
60
Plugin Contributions:
0

Re: Just another Cross-Sell mod (support thread)

Hello,
here is what I use:

PHP: 4.4.7 (Zend: 1.3.0)
MySQL 4.1.22-standard

Linux 2.6.9-55.0.2.EL

HTTP Server: Apache/1.3.37 (Unix) prxp_module/1.11.3 mod_auth_passthrough/1.8 mod_log_bytes/1.2 mod_bwlimited/1.4 PHP/4.4.7 FrontPage/5.0.2.2635.SR1.2 mod_ssl/2.8.28 OpenSSL/0.9.7a

hope it helps, because your contribution will help us.
Thanks
Michael

18 Aug 2007, 3:43 PM
#14
yellow1912 avatar

yellow1912

Totally Zenned

Join Date:
Oct 2006
Posts:
5,422
Plugin Contributions:
0

Re: Just another Cross-Sell mod (support thread)

Try to see if it works:

  1. Open admin/xsell_advanced.php
    Replace:
if (XSELL_FORM_INPUT_TYPE == "model")
            $cross_product = $db->Execute("SELECT products_id FROM " . TABLE_PRODUCTS . " WHERE products_model = '$products_id' UNION (SELECT products_id FROM ". TABLE_PRODUCTS . " WHERE products_model = '$pid')");
        else
            $cross_product = $db->Execute("SELECT products_id FROM " . TABLE_PRODUCTS . " WHERE products_id = $products_id LIMIT 1 UNION (SELECT products_id FROM ". TABLE_PRODUCTS . " WHERE products_id = $pid LIMIT 1)");

By:

if (XSELL_FORM_INPUT_TYPE == "model")
            $cross_product = $db->Execute("SELECT products_id FROM " . TABLE_PRODUCTS . " WHERE products_model IN ('$products_id', '$pid') ORDER BY FIELD (products_model, '$products_id', '$pid')");
        else
            $cross_product = $db->Execute("SELECT products_id FROM " . TABLE_PRODUCTS . " WHERE products_id IN ($products_id, $pid) ORDER BY FIELD (products_id, '$products_id', '$pid')");

As for the javascript error, I'm no js expert so it'll take me some time to see why it doesnt work with IE at all.

18 Aug 2007, 4:32 PM
#15
michaelhl avatar

michaelhl

New Zenner

Join Date:
Oct 2005
Location:
Germany
Posts:
60
Plugin Contributions:
0

Re: Just another Cross-Sell mod (support thread)

Thank you for your help, but now the rsult is as follows:

1064 You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '(products_model, '5060057722374', '5060057721971')' at line 1
in:
[SELECT products_id FROM products WHERE products_model IN ('5060057722374', '5060057721971') ORDER BY FIELD (products_model, '5060057722374', '5060057721971')]
If you were entering information, press the BACK button in your browser and re-check the information you had entered to be sure you left no blank fields.

18 Aug 2007, 4:36 PM
#16
yellow1912 avatar

yellow1912

Totally Zenned

Join Date:
Oct 2006
Posts:
5,422
Plugin Contributions:
0

Re: Just another Cross-Sell mod (support thread)

I will need to somehow get mysql 4.1 installed so I can check why this happens.
We of course can get around this easily by query 1 product at a time only, but that is my last choice. Please be patient with me.

18 Aug 2007, 5:00 PM
#17
yellow1912 avatar

yellow1912

Totally Zenned

Join Date:
Oct 2006
Posts:
5,422
Plugin Contributions:
0

Re: Just another Cross-Sell mod (support thread)

BTW, you should consider moving to a newer version of mysql soon, for the sake of performance and compatibility.
ZC will move to PHP5 in the next version, and PHP5 often goes with mysql5.
http://www.zen-cart.com/forum/showthread.php?p=417168#post417168

Concerning the js bug, I think I found out the error. Now I need to somehow get it works ^^.

18 Aug 2007, 5:39 PM
#18
yellow1912 avatar

yellow1912

Totally Zenned

Join Date:
Oct 2006
Posts:
5,422
Plugin Contributions:
0

Re: Just another Cross-Sell mod (support thread)

Try:

```
if (XSELL_FORM_INPUT_TYPE == "model")
$cross_product = $db->Execute("SELECT products_id FROM " . TABLE_PRODUCTS . " WHERE products_model IN('$products_id', '$pid') ORDER BY FIELD(products_model, '$products_id', '$pid')");
else
$cross_product = $db->Execute("SELECT products_id FROM " . TABLE_PRODUCTS . " WHERE products_id IN($products_id, $pid) ORDER BY FIELD(products_id, '$products_id', '$pid')");


(Removed space after IN and FIELD)
18 Aug 2007, 9:20 PM
#19
yellow1912 avatar

yellow1912

Totally Zenned

Join Date:
Oct 2006
Posts:
5,422
Plugin Contributions:
0

Re: Just another Cross-Sell mod (support thread)

I have the javascipt bug fixed. Let me know if the new sql works for you so I can update the mod to fix these 2 issues.
(If you cant wait, the version with js bug fix is available on svn)

19 Aug 2007, 2:44 AM
#20
yellow1912 avatar

yellow1912

Totally Zenned

Join Date:
Oct 2006
Posts:
5,422
Plugin Contributions:
0

Re: Just another Cross-Sell mod (support thread)

Alpha 1 rev 34 uploaded.

Changes:
This update addresses the javascript bug in the IE browser.
Moved some functions around to tidy up the codes.

Note:
There was a report that this mod does not work well in MySql 4.1. Let me know if you have the same problem with this version