Zen Cart Logo
Forums / All Other Contributions/Addons / Multi Cross Sell mod [Support thread]

Multi Cross Sell mod [Support thread]

Views: 85,108

Results 421 to 440 of 476
03 Dec 2013, 13:04
#421
keneso avatar

keneso

Totally Zenned

Join Date:
May 2009
Posts:
1,273
Plugin Contributions:
3

Multi Cross Sell mod [Support thread]

Thank you.

04 Dec 2013, 14:38
#422
keneso avatar

keneso

Totally Zenned

Join Date:
May 2009
Posts:
1,273
Plugin Contributions:
3

Re: Multi Cross Sell mod [Support thread]

Since I was translating this to Italian, I thought to edit YOUR_RENAMED_ADMIN/multi_xsell.php in order to make it easy for people to localize it by adding the defines.
I attach a copy for you, if you think could be worth for the next update; in case double check the files - they do work on my Zen Cart.

04 Dec 2013, 22:06
#423
gilby avatar

gilby

Totally Zenned

Join Date:
Aug 2005
Location:
Vic, Oz
Posts:
1,816
Plugin Contributions:
0

Re: Multi Cross Sell mod [Support thread]

keneso:

Since I was translating this to Italian, I thought to edit YOUR_RENAMED_ADMIN/multi_xsell.php in order to make it easy for people to localize it by adding the defines.
I attach a copy for you, if you think could be worth for the next update; in case double check the files - they do work on my Zen Cart.Thank You,
I am working on a new version and will check out your suggestions.
In the meantime it should help others that use more than one language.

05 Dec 2013, 13:00
#424
keneso avatar

keneso

Totally Zenned

Join Date:
May 2009
Posts:
1,273
Plugin Contributions:
3

Re: Multi Cross Sell mod [Support thread]

In thes setup using this I have a superuser (administrator), and a second user profile, for the latter I have enabled the access to catalog>>cross sell, and configuration>>cross sell settings, but when trying to access catalog>>cross sell I get the following:
"Sorry, your security clearance does not allow you to access this resource.
Please contact your site administrator if you believe this to be incorrect.
Sorry for any inconvenience."
No problem in accessing configuration>>cross sell settings

Thank you.

05 Dec 2013, 13:25
#425
gilby avatar

gilby

Totally Zenned

Join Date:
Aug 2005
Location:
Vic, Oz
Posts:
1,816
Plugin Contributions:
0

Re: Multi Cross Sell mod [Support thread]

keneso:

In thes setup using this I have a superuser (administrator), and a second user profile, for the latter I have enabled the access to catalog>>cross sell, and configuration>>cross sell settings, but when trying to access catalog>>cross sell I get the following:
"Sorry, your security clearance does not allow you to access this resource.
Please contact your site administrator if you believe this to be incorrect.
Sorry for any inconvenience."
No problem in accessing configuration>>cross sell settings

Thank you.Also a bug (sort of) 1.5 changed the way some files are defined
see post# 338

05 Dec 2013, 13:50
#426
keneso avatar

keneso

Totally Zenned

Join Date:
May 2009
Posts:
1,273
Plugin Contributions:
3

Re: Multi Cross Sell mod [Support thread]

Thank you, I appreciate your patience.

28 Jan 2014, 07:16
#427
danielle avatar

danielle

Totally Zenned

Join Date:
Oct 2004
Posts:
973
Plugin Contributions:
0

Re: Multi Cross Sell mod [Support thread]

I know a few people have asked how to get the cross sells to show in the shopping cart, so I thought I'd post a solution. I didn't write this from scratch, just made a few changes to an old mod (Upsells/Cross Sells in Shopping Cart). I've only tested this on v1.5.1.

Create a new file: includes/modules/YOUR_TEMPLATE/cart_upsell.php with this code:

<?php if (!defined('MAX_DISPLAY_XSELL')) define('MAX_DISPLAY_XSELL',6); if (!defined('MIN_DISPLAY_XSELL')) define('MIN_DISPLAY_XSELL',1); if (!defined('SHOW_PRODUCT_INFO_COLUMNS_XSELL_PRODUCTS')) define('SHOW_PRODUCT_INFO_COLUMNS_XSELL_PRODUCTS',3); if ($_SESSION['cart']->contents) { $i = 0; foreach($_SESSION['cart']->contents as $id => $qty) { $prod[$i] = zen_get_prid($id); $i++; } $cross_sell = 1; //check if cross_sell module installed if (@file_exists(DIR_WS_MODULES . zen_get_module_directory('multi_xsell_products.php'))) { $c = MAX_DISPLAY_XSELL; $num = round($c/sizeof($prod)); $extra = $num + 1; $max = $c; for ($i = 0; $i < sizeof($prod); $i++) { if ($i < sizeof($prod) - 1) { $cross_sell_sort_by = XSELL_SORT_ORDER . $mxsell=="sort_order"?" order by xp.sort_order asc ": " order by rand() "; $cross_sell_query_raw .= "(select p.products_id, p.products_image from " . TABLE_PRODUCTS_MXSELL . $cross_sell . " xp, " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd where xp.products_id = '" . $prod[$i] . "' and xp.xsell_id = p.products_id and p.products_id = pd.products_id and pd.language_id = '" . $_SESSION['languages_id'] . "' and p.products_status = 1 " . $cross_sell_sort_by." limit " . MAX_DISPLAY_XSELL . ") UNION "; $c -= $num; } else { $c += 2; $cross_sell_sort_by = XSELL_SORT_ORDER . $mxsell=="sort_order"?" order by xp.sort_order asc ": " order by rand() "; $cross_sell_query_raw .= "(select p.products_id, p.products_image from " . TABLE_PRODUCTS_MXSELL . $cross_sell . " xp, " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd where xp.products_id = '" . $prod[$i] . "' and xp.xsell_id = p.products_id and p.products_id = pd.products_id and pd.language_id = '" . $_SESSION['languages_id'] . "' and p.products_status = 1 " . $cross_sell_sort_by." limit " . MAX_DISPLAY_XSELL . ")"; } } $cross_sell_query = $db->Execute($cross_sell_query_raw); $db->Execute("create temporary table cross_sell ( products_id int(11), products_image varchar(64) )"); while (!$cross_sell_query->EOF) { $db->Execute("insert into cross_sell values('" . $cross_sell_query->fields['products_id'] . "', '" . $cross_sell_query->fields['products_image'] . "')"); $cross_sell_query->MoveNext(); } for ($i = 0; $i < sizeof($prod); $i++) { $db->Execute("delete from cross_sell where products_id = '" . $prod[$i] . "'"); } $cross_sell_query_final = "select * from cross_sell limit " . $max; $cross_sell_final = $db->Execute($cross_sell_query_final); $db->Execute("drop table cross_sell"); $num_products_cross_sell = $cross_sell_final->RecordCount(); if ($num_products_cross_sell >= MIN_DISPLAY_XSELL) { $row = 0; $col = 0; $list_box_contents = array(); $title = ''; if ($num_products_cross_sell < SHOW_PRODUCT_INFO_COLUMNS_XSELL_PRODUCTS || SHOW_PRODUCT_INFO_COLUMNS_XSELL_PRODUCTS==0) { $col_width = floor(100/$num_products_cross_sell); } else { $col_width = floor(100/SHOW_PRODUCT_INFO_COLUMNS_XSELL_PRODUCTS); } while (!$cross_sell_final->EOF) { if (zen_has_product_attributes($cross_sell_final->fields['products_id']) or PRODUCT_LIST_PRICE_BUY_NOW == '0') { $lc_button = '<br /><a href="' . zen_href_link(zen_get_info_page($cross_sell_final->fields['products_id']), '&products_id=' . $cross_sell_final->fields['products_id']) . '">' . MORE_INFO_TEXT . '</a><br />'; } else { $lc_button = '<br /><a href="' . zen_href_link(FILENAME_SHOPPING_CART, 'action=buy_now&products_id=' . $cross_sell_final->fields['products_id']) . '">' . zen_image_button(BUTTON_IMAGE_BUY_NOW, BUTTON_BUY_NOW_ALT) . '</a>'; } $cross_sell_final->fields['products_name'] = zen_get_products_name($cross_sell_final->fields['products_id']); $list_box_contents[$row][$col] = array('params' => 'class="centerBoxContentsCrossSell centeredContent back"' . ' ' . 'style="width:' . $col_width . '%;"', 'text' => '<div class="listingProductImage" style="margin-top: 5px; margin-bottom: 5px;"><a href="' . zen_href_link(zen_get_info_page($cross_sell_final->fields['products_id']), 'products_id=' . $cross_sell_final->fields['products_id']) . '">' . zen_image(DIR_WS_IMAGES . $cross_sell_final->fields['products_image'], $cross_sell_final->fields['products_name'], SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT) . '</a></div>'. (constant(CROSS_SELL.$cross_sell._DISPLAY_NAME)=='true'? '<div class="itemTitle"><h4 class="itemTitle"><a href="' . zen_href_link(zen_get_info_page($cross_sell_final->fields['products_id']), 'products_id=' . $cross_sell_final->fields['products_id']) . '">' . $cross_sell_final->fields['products_name'] . '</a></h4></div>':'').(constant(CROSS_SELL.$cross_sell._DISPLAY_MODEL)=='true'? '<div class="itemModel"><h4 class="itemTitle"><a href="' . zen_href_link(zen_get_info_page($cross_sell_final->fields['products_id']), 'products_id=' . $cross_sell_final->fields['products_id']) . '">' . zen_products_lookup($cross_sell_final->fields['products_id'], 'products_model') . '</a></h4></div>':'').(constant(CROSS_SELL.$cross_sell._DISPLAY_PRICE)=='true'? '<div class="price">'.zen_get_products_display_price($cross_sell_final->fields['products_id']).'</div>':'') .(constant(CROSS_SELL.$cross_sell._DISPLAY_BUY_NOW)=='true'? '<div class="listingBuyNowButton">'.$lc_button.'</div>':'') ); $col ++; if ($col > 2) { $col = 0; $row ++; } $cross_sell_final->MoveNext(); } $cross_sell_data = $list_box_contents; ?> <br class="clearBoth"> <div class="centerBoxWrapper" id="crossSell"> <?php require($template->get_template_dir('tpl_columnar_display.php',DIR_WS_TEMPLATE, $current_page_base,'common'). '/tpl_columnar_display.php'); ?> </div> <?php } } } ?>

Add this to your includes/templates/YOUR_TEMPLATE/templates/tpl_shopping_cart.php file wherever you want the cross sells to show up:

<?php require(DIR_WS_MODULES . zen_get_module_directory('cart_upsell.php')); ?>

That's it!

28 Jan 2014, 19:33
#428
mcpisik avatar

mcpisik

Zen Follower

Join Date:
Jan 2007
Location:
Mount Maunganui, New Zealand
Posts:
417
Plugin Contributions:
0

Re: Multi Cross Sell mod [Support thread]

What a great day. I've been searching for this fix for so long.
Completely appreciate you taking the time to post this solution.
(Might be good to pack for the Plugins section)

Any idea how I might add a line of text above the xsells on the shopping cart page, that says "We thought you might like to add..."?
I'm concerned people might think they're checking out with the item I'm recommending, instead of what they added to cart.
Or even a horizontal rule to separate...

Again, much appreciated!

28 Jan 2014, 19:45
#429
danielle avatar

danielle

Totally Zenned

Join Date:
Oct 2004
Posts:
973
Plugin Contributions:
0

Re: Multi Cross Sell mod [Support thread]

Sure, just put this in the shopping_cart.tpl file:

<h2>You May Also Like...</h2> <hr/> <?php require(DIR_WS_MODULES . zen_get_module_directory('cart_upsell.php')); ?>

That's not the cleanest way to do it, but it will work for now. When I have a chance I will package it up as a mod and add language definitions, etc.

mcpisik:

What a great day. I've been searching for this fix for so long.
Completely appreciate you taking the time to post this solution.
(Might be good to pack for the Plugins section)

Any idea how I might add a line of text above the xsells on the shopping cart page, that says "We thought you might like to add..."?
I'm concerned people might think they're checking out with the item I'm recommending, instead of what they added to cart.
Or even a horizontal rule to separate...

Again, much appreciated!

28 Jan 2014, 20:05
#430
mcpisik avatar

mcpisik

Zen Follower

Join Date:
Jan 2007
Location:
Mount Maunganui, New Zealand
Posts:
417
Plugin Contributions:
0

Re: Multi Cross Sell mod [Support thread]

Brilliant :)

29 Aug 2014, 11:31
#431
ptowers49 avatar

ptowers49

New Zenner

Join Date:
Aug 2009
Location:
UK
Posts:
71
Plugin Contributions:
0

Re: Multi Cross Sell mod [Support thread]

Hi does this module work with 1.5.3?
Regards
Paul

29 Aug 2014, 12:00
#432
gilby avatar

gilby

Totally Zenned

Join Date:
Aug 2005
Location:
Vic, Oz
Posts:
1,816
Plugin Contributions:
0

Re: Multi Cross Sell mod [Support thread]

ptowers49:

Hi does this module work with 1.5.3?
Regards
PaulI haven't tested it yet as is.
Still on the to-do list

30 Aug 2014, 20:44
#433
ptowers49 avatar

ptowers49

New Zenner

Join Date:
Aug 2009
Location:
UK
Posts:
71
Plugin Contributions:
0

Re: Multi Cross Sell mod [Support thread]

any idea on the timing for the testing as it is a good module?
Regards
Paul

31 Aug 2014, 00:09
#434
gilby avatar

gilby

Totally Zenned

Join Date:
Aug 2005
Location:
Vic, Oz
Posts:
1,816
Plugin Contributions:
0

Re: Multi Cross Sell mod [Support thread]

ptowers49:

any idea on the timing for the testing as it is a good module?
Regards
PaulProbably 4 to 5 weeks as I have lot on at the moment.
It will include a few small fixes for php and mysql changes as well

07 Sep 2014, 19:16
#435
andy_c27 avatar

andy_c27

Zen Follower

Join Date:
Oct 2010
Location:
United Kingdom
Posts:
477
Plugin Contributions:
0

Re: Multi Cross Sell mod [Support thread]

Hey guys can I ask is cross sell the same as linking pages in the eyes of google or not ..Just wondering that's all as a lot of my products are used in this way

thanks

11 Nov 2014, 00:41
#436
k1ra avatar

k1ra

New Zenner

Join Date:
Jul 2013
Posts:
57
Plugin Contributions:
0

Re: Multi Cross Sell mod [Support thread]

I am having an odd problem with this mod. Not sure when it started, but I noticed today that Cross Sell is not showing on the product page. I uninstalled/re-installed, added the display code to default template and switched templates in Admin, but it's still a no-show. Any ideas as to what may be causing this?

11 Nov 2014, 00:46
#437
gilby avatar

gilby

Totally Zenned

Join Date:
Aug 2005
Location:
Vic, Oz
Posts:
1,816
Plugin Contributions:
0

Re: Multi Cross Sell mod [Support thread]

k1ra:

I am having an odd problem with this mod. Not sure when it started, but I noticed today that Cross Sell is not showing on the product page. I uninstalled/re-installed, added the display code to default template and switched templates in Admin, but it's still a no-show. Any ideas as to what may be causing this?Please reply and answer the posting tips at the top of page including what version of zen-cart?
What version of this mod?
What version of php?
And a link to a product that should normally show cross sells?

20 Jan 2015, 21:29
#438
mydanilo avatar

mydanilo

Totally Zenned

Join Date:
Dec 2004
Posts:
1,024
Plugin Contributions:
0

Re: Multi Cross Sell mod [Support thread]

I saw the tip on how to put xsell items on cart page, upsell style. did anybody create a complete solution? It works to just display xsell item pictures below the cart but the Cross Sell Settings in admin like price or buy now button do not show up. Anybody done that?

21 Feb 2015, 20:41
#439
amandarm avatar

amandarm

New Zenner

Join Date:
Feb 2015
Location:
Hotchkiss, CO
Posts:
15
Plugin Contributions:
0

Re: Multi Cross Sell mod [Support thread]

ilmarchez:

Hi, I've installed 1.02 on Zencart 1.3.9h it works but I have a problem:

  1. the header of each cross sell soes not show up (like "Suggested Matching Items...")
  2. how and where could I change this title?

You can see it in action here: http://tinyurl.com/d5h768d

Thanks for your help!
Stefano

I am having the same problem..."Suggested Matching Items..." is not showing up on my module. Any suggestions?

Thanks

21 Feb 2015, 20:58
#440
jeking avatar

jeking

Totally Zenned

Join Date:
Oct 2005
Location:
Chicago, IL USA
Posts:
1,592
Plugin Contributions:
0

Re: Multi Cross Sell mod [Support thread]

amandarm:

I am having the same problem..."Suggested Matching Items..." is not showing up on my module. Any suggestions?

Thanks

Please reply and answer the posting tips at the top of page including what version of zen-cart?
What version of this mod?
What version of php?
And a link to a product that should normally show cross sells?