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

Multi Cross Sell mod [Support thread]

Views: 85,316

Results 41 to 60 of 476
23 Aug 2010, 3:23 PM
#41
beyre avatar

beyre

Zen Follower

Join Date:
Feb 2009
Posts:
422
Plugin Contributions:
0

Multi Cross Sell mod [Support thread]

Just installed this mod and no errors while installing.
However, I can't get the feature to actually show on a product page.

This is the product page I'm working on to start:
http://www.vintagegunleather.com/shoppe/index.php?main_page=product_info&cPath=1&products_id=276

It is supposed to show beneath the add to cart, so it'll be the last thing on the page.

When you view the page source code you see it ends with:

<!--bof Add to Cart Box -->
                  <div id="cartAdd">
    <input type="hidden" name="cart_quantity" value="1" /><input type="hidden" name="products_id" value="276" /><input type="image" src="includes/templates/vgl/buttons/english/button_in_cart.gif" alt="Add to Cart" title=" Add to Cart " />          </div>
  <br class="clearBoth" />
<!--eof Add to Cart Box-->

<!-- BEG: Multi Cross-Sell mod -->

But yet, the actual file from that point on is:

<!--bof Add to Cart Box -->
<?php
if (CUSTOMERS_APPROVAL == 3 and TEXT_LOGIN_FOR_PRICE_BUTTON_REPLACE_SHOWROOM == '') {
  // do nothing
} else {
?>
            <?php
    $display_qty = (($flag_show_product_info_in_cart_qty == 1 and $_SESSION['cart']->in_cart($_GET['products_id'])) ? '<p>' . PRODUCTS_ORDER_QTY_TEXT_IN_CART . $_SESSION['cart']->get_quantity($_GET['products_id']) . '</p>' : '');
            if ($products_qty_box_status == 0 or $products_quantity_order_max== 1) {
              // hide the quantity box and default to 1
              $the_button = '<input type="hidden" name="cart_quantity" value="1" />' . zen_draw_hidden_field('products_id', (int)$_GET['products_id']) . zen_image_submit(BUTTON_IMAGE_IN_CART, BUTTON_IN_CART_ALT);
            } else {
              // show the quantity box
    $the_button = PRODUCTS_ORDER_QTY_TEXT . '<input type="text" name="cart_quantity" value="' . (zen_get_buy_now_qty($_GET['products_id'])) . '" maxlength="6" size="4" />' . zen_get_products_quantity_min_units_display((int)$_GET['products_id']) . '' . zen_draw_hidden_field('products_id', (int)$_GET['products_id']) . zen_image_submit(BUTTON_IMAGE_IN_CART, BUTTON_IN_CART_ALT);
            }
    $display_button = zen_get_buy_now_button($_GET['products_id'], $the_button);
  ?>
  <?php if ($display_qty != '' or $display_button != '') { ?>
    <div id="cartAdd">
    <?php
      echo $display_qty;
      echo $display_button;
            ?>
          </div>
  <?php } // display qty and button ?>
<?php } // CUSTOMERS_APPROVAL == 3 ?>
<br class="clearBoth" />
<!--eof Add to Cart Box-->

<!-- BEG: Multi Cross-Sell mod -->
<?php
  if(defined('MXSELL_ENABLED') && MXSELL_ENABLED == 'true') {
    for ( $mxsell = 1; $mxsell <= MXSELL_NUM_OF_TABLES; $mxsell++ ) { // show all cross sells
      require($template->get_template_dir('tpl_modules_multi_xsell_products.php', DIR_WS_TEMPLATE, $current_page_base,'templates'). '/' . 'tpl_modules_multi_xsell_products.php');
    }
  }
?>
<!-- END: Multi Cross-Sell mod -->

<!--bof Prev/Next bottom position -->
<?php if (PRODUCT_INFO_PREVIOUS_NEXT == 2 or PRODUCT_INFO_PREVIOUS_NEXT == 3) { ?>
<?php
/**
 * display the product previous/next helper
 */
 require($template->get_template_dir('/tpl_products_next_previous.php',DIR_WS_TEMPLATE, $current_page_base,'templates'). '/tpl_products_next_previous.php'); ?>
<?php } ?>
<!--eof Prev/Next bottom position -->

<!--bof Quantity Discounts table -->
<?php
  if ($products_discount_type != 0) { ?>
<?php
/**
 * display the products quantity discount
 */
 require($template->get_template_dir('/tpl_modules_products_quantity_discounts.php',DIR_WS_TEMPLATE, $current_page_base,'templates'). '/tpl_modules_products_quantity_discounts.php'); ?>
<?php
  }
?>
<!--eof Quantity Discounts table -->

<!--bof Product URL -->
<?php
  if (zen_not_null($products_url)) {
    if ($flag_show_product_info_url == 1) {
?>
    <p id="productInfoLink" class="productGeneral centeredContent"><?php echo sprintf(TEXT_MORE_INFORMATION, zen_href_link(FILENAME_REDIRECT, 'action=url&goto=' . urlencode($products_url), 'NONSSL', true, false)); ?></p>
<?php
    } // $flag_show_product_info_url
  }
?>
<!--eof Product URL -->

<!--bof also purchased products module-->
<?php require($template->get_template_dir('tpl_modules_also_purchased_products.php', DIR_WS_TEMPLATE, $current_page_base,'templates'). '/' . 'tpl_modules_also_purchased_products.php');?>
<!--eof also purchased products module-->

<!--bof Form close-->
</form>
<!--bof Form close-->
</div>

So, something in the cross sell code above is breaking the page's code. I don't know enough about PHP to pinpoint the problem. This is a direct copy and past from the Sample file. What was in the Document file didn't have that first "if" line (about Enabling).

Zencart V 3.1.8a
I have the module set for 1 cross sell box, 3 products across, 3 products max.

23 Aug 2010, 11:36 PM
#42
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]

beyre:

Just installed this mod and no errors while installing.
However, I can't get the feature to actually show on a product page.

So, something in the cross sell code above is breaking the page's code. I don't know enough about PHP to pinpoint the problem. This is a direct copy and past from the Sample file. What was in the Document file didn't have that first "if" line (about Enabling).

Zencart V 3.1.8a
I have the module set for 1 cross sell box, 3 products across, 3 products max.

As you are using v138a install this
http://www.zen-cart.com/index.php?main_page=product_contrib_info&products_id=860
so that you can find the php error that is causing the error

You could also try using the included file to see if that works instead of modifying yours.
If that works there could be a conflict with other customisations you have made to this file.

24 Aug 2010, 2:41 PM
#43
beyre avatar

beyre

Zen Follower

Join Date:
Feb 2009
Posts:
422
Plugin Contributions:
0

Re: Multi Cross Sell mod [Support thread]

Thanks for your reply.

It seemed the tpl_modules_multi_xsell_products.php file didn't upload when I told it to and I didn't pay attention to that.

But now, on that same product page, I get the following error:

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 7
in:
[select distinct p.products_id, p.products_image, pd.products_name from products_xsell1 xp, products p, products_description pd where xp.products_id = '276' and xp.xsell_id = p.products_id and p.products_id = pd.products_id and pd.language_id = '1' and p.products_status = 1 order by rand() limit ]

This was also in the debugging file:

161
[24-Aug-2010 07:23:18] PHP Fatal error: require() [<a href='function.require'>function.require</a>]: Failed opening required 'includes/templates/template_default/templates/tpl_modules_multi_xsell_products.php' (include_path='.:.:') in /var/www/vhosts/vintagegunleather.com/httpdocs/shoppe/includes/templates/vgl/templates/tpl_product_info_display.php on line 161

25 Aug 2010, 12:31 AM
#44
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]

beyre:

Thanks for your reply.

It seemed the tpl_modules_multi_xsell_products.php file didn't upload when I told it to and I didn't pay attention to that.
Thats what the debug error message was telling you was missing.

beyre:

But now, on that same product page, I get the following error:

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 7
in:
[select distinct p.products_id, p.products_image, pd.products_name from products_xsell1 xp, products p, products_description pd where xp.products_id = '276' and xp.xsell_id = p.products_id and p.products_id = pd.products_id and pd.language_id = '1' and p.products_status = 1 order by rand() limit ]

You have had a previous cross sell installed and haven't totally removed it.
See post #34 for the answer

25 Aug 2010, 6:22 AM
#45
beyre avatar

beyre

Zen Follower

Join Date:
Feb 2009
Posts:
422
Plugin Contributions:
0

Re: Multi Cross Sell mod [Support thread]

Thank you so much. That was the winning ticket!
Easy enough solution - just needed someone to interpret the gobblety-gook to get there! :clap:

25 Aug 2010, 1:22 PM
#46
philip937 avatar

philip937

Totally Zenned

Join Date:
Aug 2009
Location:
Bedford, England
Posts:
968
Plugin Contributions:
0

Re: Multi Cross Sell mod [Support thread]

@gilby

I currently use Just another Cross-Sell mod on 1.3.8. After finding that it does not work on my 1.3.9 I saw this mod.

a few questions though.
Q1
is the data base exactly the same? i.e so i can transfer my current table to be use with this mod in 1.3.9?

Q2
when it says about the removal of modle manager, do you mean so it can work without the need for module manager? as apposed to having to actually remove module manager? I ask because other mods I have use mod manager?

Q3
is this mod compatible with cart upsell?

look forward to hearing from you.

Thanks

Phil

Phil Rogers
A problem shared is a problem solved.

25 Aug 2010, 1:44 PM
#47
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]

philip937:

@gilby

I currently use Just another Cross-Sell mod on 1.3.8. After finding that it does not work on my 1.3.9 I saw this mod.

a few questions though.
Q1
is the data base exactly the same? i.e so i can transfer my current table to be use with this mod in 1.3.9?

Q2
when it says about the removal of modle manager, do you mean so it can work without the need for module manager? as apposed to having to actually remove module manager? I ask because other mods I have use mod manager?

Q3
is this mod compatible with cart upsell?

look forward to hearing from you.

Thanks

Phil

Q1 Yes!
From the included docs:
To retain any existing Cross Sells rename the "products_xsell" table to "products_xsell1"
It needs to be renamed before clicking the install button on this new mod.
Otherwise a "products_xsell1" table will be created as none was found.

Q2 You don't need module manager to run this mod
Whether it is installed or not makes no difference

Q3 Or.. Is Cart Upsell compatible with this mod?
Cart Upsell expects one cross sell only not many.
So you can use it, as is, to display one of the cross sells.
Work out which cross sell you want to use there and edit that mod so you rename references to "products_xsell" table to "products_xsell1" for example if you want to use the first cross sell for that purpose.

25 Aug 2010, 3:20 PM
#48
philip937 avatar

philip937

Totally Zenned

Join Date:
Aug 2009
Location:
Bedford, England
Posts:
968
Plugin Contributions:
0

Re: Multi Cross Sell mod [Support thread]

gilby:

Q1 Yes!
From the included docs:
To retain any existing Cross Sells rename the "products_xsell" table to "products_xsell1"
It needs to be renamed before clicking the install button on this new mod.
Otherwise a "products_xsell1" table will be created as none was found.

Q2 You don't need module manager to run this mod
Whether it is installed or not makes no difference

Q3 Or.. Is Cart Upsell compatible with this mod?
Cart Upsell expects one cross sell only not many.
So you can use it, as is, to display one of the cross sells.
Work out which cross sell you want to use there and edit that mod so you rename references to "products_xsell" table to "products_xsell1" for example if you want to use the first cross sell for that purpose.

I am going to remove the cross sell I have completley and backup the table products_xsell then delete it, then install this new Mod.

Almost there, however I still have "Cross Sell" under admin/configuration?? Looking through the mod files there was no uninstall database for it??

any Idea how I can safely remove? or does your mod just overwrite this?

thanks in advance.

Phil

Phil Rogers
A problem shared is a problem solved.

25 Aug 2010, 4:25 PM
#49
philip937 avatar

philip937

Totally Zenned

Join Date:
Aug 2009
Location:
Bedford, England
Posts:
968
Plugin Contributions:
0

Re: Multi Cross Sell mod [Support thread]

FANTASTIC ALL done and working!

Looks great, need to work out the cart upsell so I will take a look at the files and see if I can find where it references the table :o)

Phil Rogers
A problem shared is a problem solved.

25 Aug 2010, 7:15 PM
#50
philip937 avatar

philip937

Totally Zenned

Join Date:
Aug 2009
Location:
Bedford, England
Posts:
968
Plugin Contributions:
0

Re: Multi Cross Sell mod [Support thread]

@gilby

gilby:

Q1 Yes!
Q3 Or.. Is Cart Upsell compatible with this mod?
Cart Upsell expects one cross sell only not many.
So you can use it, as is, to display one of the cross sells.
Work out which cross sell you want to use there and edit that mod so you rename references to "products_xsell" table to "products_xsell1" for example if you want to use the first cross sell for that purpose.

I have tried what you suggested but its not working for some reason.

this is what I did:

I added this line to
includes/extra_datafiles/multi_xsell_definitions.php

define('TABLE_PRODUCTS_XSELL', DB_PREFIX . 'products_xsell1');

then I have to change in
includes/modules/MY_TEMPLATE/cart_upsell.php

    if (@file_exists(DIR_WS_MODULES . zen_get_module_directory('xsell_products.php'))) {

to

    if (@file_exists(DIR_WS_MODULES . zen_get_module_directory('multi_xsell_products.php'))) {

and

require($template->get_template_dir('tpl_modules_xsell_products.php', DIR_WS_TEMPLATE, $current_page_base,'templates'). '/' . 'tpl_modules_xsell_products.php');

to

require($template->get_template_dir('tpl_modules_multi_xsell_products.php', DIR_WS_TEMPLATE, $current_page_base,'templates'). '/' . 'tpl_modules_multi_xsell_products.php');

but this still does not work. can you advise any further?

Many Thanks

Phil Rogers
A problem shared is a problem solved.

25 Aug 2010, 10:17 PM
#51
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]

philip937:

@gilby

I have tried what you suggested but its not working for some reason.

this is what I did:

I added this line to
includes/extra_datafiles/multi_xsell_definitions.php

define('TABLE_PRODUCTS_XSELL', DB_PREFIX . 'products_xsell1');

> 
> then I have to change in 
> includes/modules/MY_TEMPLATE/cart_upsell.php
> ```php
    if (@file_exists(DIR_WS_MODULES . zen_get_module_directory('xsell_products.php'))) {

to

if (@file_exists(DIR_WS_MODULES . zen_get_module_directory('multi_xsell_products.php'))) {
> and
> ```php
require($template->get_template_dir('tpl_modules_xsell_products.php', DIR_WS_TEMPLATE, $current_page_base,'templates'). '/' . 'tpl_modules_xsell_products.php');

to

require($template->get_template_dir('tpl_modules_multi_xsell_products.php', DIR_WS_TEMPLATE, $current_page_base,'templates'). '/' . 'tpl_modules_multi_xsell_products.php');

> 
> but this still does not work.  can you advise any further?
> 
> Many Thanks


At this stage no I can't help
and I am away from my test computer for the next 10 days so I can't test it out at this time
26 Aug 2010, 7:09 AM
#52
philip937 avatar

philip937

Totally Zenned

Join Date:
Aug 2009
Location:
Bedford, England
Posts:
968
Plugin Contributions:
0

Re: Multi Cross Sell mod [Support thread]

gilby:

At this stage no I can't help
and I am away from my test computer for the next 10 days so I can't test it out at this time

ok no worries, i'll keep looking at it to see if I can see any reason why its not working.

Phil Rogers
A problem shared is a problem solved.

26 Aug 2010, 2:42 PM
#53
philip937 avatar

philip937

Totally Zenned

Join Date:
Aug 2009
Location:
Bedford, England
Posts:
968
Plugin Contributions:
0

Re: Multi Cross Sell mod [Support thread]

ok, well I got it to work, however, its does not work using the file tpl_modules_multi_xsell_products.php

so as a fix, I just included the old file on my server as well solely for cart upsell to use unless someone can work out what the difference is that causes it not to work.

so all I did was specified the table products_xsell1 and made sure I had includes/templates/MY_TEMPLATE/templates/tpl_modules_xsell_products.php

so that when cart upsell calls it here:

      require($template->get_template_dir('tpl_modules_xsell_products.php', DIR_WS_TEMPLATE, $current_page_base,'templates'). '/' . 'tpl_modules_xsell_products.php');    }

its works.

like I say, bit of a fudge but I really like cart upsell. :o)

Phil Rogers
A problem shared is a problem solved.

28 Aug 2010, 3:30 AM
#54
bovo_cn avatar

bovo_cn

New Zenner

Join Date:
Jul 2010
Posts:
1
Plugin Contributions:
0

Re: Multi Cross Sell mod [Support thread]

After several unsuccessful installation, I want to ask: there must be installed before installing multi_cross_sell_v1.00 module_manager not ah?
Since I installed multi_cross_sell_v1.00 including previously installed module_manager still can not display the Admin-> Catalog-> Advanced Cross-Sell
Dear brothers and sisters would help. I am using a host of bluehost.com: MySQL version 5.1.47. PHP Version 5.2.13

30 Aug 2010, 9:09 AM
#55
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]

bovo_cn:

After several unsuccessful installation, I want to ask: there must be installed before installing multi_cross_sell_v1.00 module_manager not ah?
Since I installed multi_cross_sell_v1.00 including previously installed module_manager still can not display the Admin-> Catalog-> Advanced Cross-Sell
Dear brothers and sisters would help. I am using a host of bluehost.com: MySQL version 5.1.47. PHP Version 5.2.13

You may be mixing up your mods here...

This mod is stand alone...
Module manager is not used with this mod at all

"Admin-> Catalog-> Advanced Cross-Sell" is from a different cross sell mod, and is not used with this mod

This mod uses:
"Admin-> Catalog-> Multi Cross-Sell"

You should try uploading the files again to their correct position.
And maybe removing any other cross sell mods that you may have had installed previously

2 Sep 2010, 2:16 PM
#56
dvdtitan avatar

dvdtitan

New Zenner

Join Date:
Apr 2007
Posts:
87
Plugin Contributions:
0

Re: Multi Cross Sell mod [Support thread]

I have installed this on a site i look after.

It seems to work fine on a product which has multiple product images:

see here:

http://www.projobdistribution.co.uk/index.php?main_page=product_info&cPath=1&products_id=218

But the styling breaks when there are not multiple product images:

see here:

http://www.projobdistribution.co.uk/index.php?main_page=product_info&cPath=1&products_id=221

Any ideas?

3 Sep 2010, 12:38 AM
#57
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]

DVDTitan:

I have installed this on a site i look after.

It seems to work fine on a product which has multiple product images:

see here:

http://www.projobdistribution.co.uk/index.php?main_page=product_info&cPath=1&products_id=218

But the styling breaks when there are not multiple product images:

see here:

http://www.projobdistribution.co.uk/index.php?main_page=product_info&cPath=1&products_id=221

Any ideas?

Add the following line just before the start of the mod on the product_info page

<br class="clearBoth" />

See if that fixes your problem

3 Sep 2010, 8:51 AM
#58
dvdtitan avatar

dvdtitan

New Zenner

Join Date:
Apr 2007
Posts:
87
Plugin Contributions:
0

Re: Multi Cross Sell mod [Support thread]

gilby:

Add the following line just before the start of the mod on the product_info page

<br class="clearBoth" /> ```See if that fixes your problem

Yes, this fixed it. Many thanks!

4 Sep 2010, 7:50 PM
#59
berserker avatar

berserker

Totally Zenned

Join Date:
May 2006
Posts:
712
Plugin Contributions:
0

Re: Multi Cross Sell mod [Support thread]

Thanks for the fix for the category name.
Im trying to get the product name to be beside the image instead of below it, which file am I supposed to edit? I only have 1 product per row so having the name below the image takes too much space.

Thanks

5 Sep 2010, 12:15 AM
#60
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]

Berserker:

Thanks for the fix for the category name.
Im trying to get the product name to be beside the image instead of below it, which file am I supposed to edit? I only have 1 product per row so having the name below the image takes too much space.

Thanks

\includes\modules\YOUR_TEMPLATE\multi_xsell_products.php
would be the place to start