Re: 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/sho...roducts_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:
Code:
<!--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:
Code:
<!--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.
Re: Multi Cross Sell mod [Support thread]
Quote:
Originally Posted by
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?ma...roducts_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.
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
Re: Multi Cross Sell mod [Support thread]
Quote:
Originally Posted by
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.
Quote:
Originally Posted by
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
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:
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
Re: Multi Cross Sell mod [Support thread]
Quote:
Originally Posted by
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.
Re: Multi Cross Sell mod [Support thread]
Quote:
Originally Posted by
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
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)
Re: Multi Cross Sell mod [Support thread]
@gilby
Quote:
Originally Posted by
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
PHP Code:
define('TABLE_PRODUCTS_XSELL', DB_PREFIX . 'products_xsell1');
then I have to change in
includes/modules/MY_TEMPLATE/cart_upsell.php
PHP Code:
if (@file_exists(DIR_WS_MODULES . zen_get_module_directory('xsell_products.php'))) {
to
PHP Code:
if (@file_exists(DIR_WS_MODULES . zen_get_module_directory('multi_xsell_products.php'))) {
and
PHP Code:
require($template->get_template_dir('tpl_modules_xsell_products.php', DIR_WS_TEMPLATE, $current_page_base,'templates'). '/' . 'tpl_modules_xsell_products.php');
to
PHP Code:
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