Results 1 to 4 of 4
  1. #1
    Join Date
    Mar 2009
    Posts
    38
    Plugin Contributions
    0

    bug Cross Sell Mod Automaticly Adding Item To Cart?

    Hi all,

    i download the cross sell module
    (http://www.zen-cart.com/index.php?ma...products_id=76)

    and wanted the ability to add suggestions to cart right from the cross sell box

    so i installed this mod

    http://www.zen-cart.com/forum/showthread.php?t=75097

    it added the options to add to cart, But now when i try to add the main products to cart (not the suggestion) it adds the first suggestion instead.



    here is a link to see what im talking about:

    http://www.designdomain1.com/index.p...roducts_id=185



    anybody have an idea what could be causing this?



    Many thanks!

  2. #2
    Join Date
    Mar 2009
    Posts
    38
    Plugin Contributions
    0

    Default Re: Cross Sell Mod Automaticly Adding Item To Cart?

    here is the entire code i am using for the cross sell module


    <?php
    /**
    * Cross Sell products
    *
    * Derived from:
    * Original Idea From Isaac Mualem [email protected] <mailto:[email protected]>
    * Portions Copyright (c) 2002 osCommerce
    * Complete Recoding From Stephen Walker [email protected]
    * Released under the GNU General Public License
    *
    * Adapted to Zen Cart by Merlin - Spring 2005
    * Reworked for Zen Cart v1.3.0 03-30-2006
    */

    // in case admin switches aren't added properly, assume default settings:
    if (!defined('MAX_DISPLAY_XSELL')) define('MAX_DISPLAY_XSELL',6);
    if (!defined('MIN_DISPLAY_XSELL')) define('MIN_DISPLAY_XSELL',1);
    if (!defined('XSELL_DISPLAY_PRICE')) define('XSELL_DISPLAY_PRICE','false');
    if (!defined('SHOW_PRODUCT_INFO_COLUMNS_XSELL_PRODUCTS')) define('SHOW_PRODUCT_INFO_COLUMNS_XSELL_PRODUCTS',2);

    // collect information on available cross-sell products for the current product-id
    if (isset($_GET['products_id']) && SHOW_PRODUCT_INFO_COLUMNS_XSELL_PRODUCTS > 0 ) {
    $xsell_query = $db->Execute("select distinct p.products_id, p.products_image, pd.products_name
    from " . TABLE_PRODUCTS_XSELL . " xp, " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd
    where xp.products_id = '" . $_GET['products_id'] . "'
    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
    order by xp.sort_order asc limit " . MAX_DISPLAY_XSELL);
    $num_products_xsell = $xsell_query->RecordCount();

    // don't display if less than the minimum amount set in Admin->Config->Minimum Values->Cross-Sell
    if ($num_products_xsell >= MIN_DISPLAY_XSELL && $num_products_xsell > 0) {
    ?>
    <!-- xsell_products //-->
    <?php
    $row = 0;
    $col = 0;
    $list_box_contents = array();
    $title='';
    if ($num_products_xsell < SHOW_PRODUCT_INFO_COLUMNS_XSELL_PRODUCTS || SHOW_PRODUCT_INFO_COLUMNS_XSELL_PRODUCTS==0) {
    $col_width = floor(100/$num_products_xsell);
    } else {
    $col_width = floor(100/SHOW_PRODUCT_INFO_COLUMNS_XSELL_PRODUCTS);
    }
    while (!$xsell_query->EOF) {
    $products_price = zen_get_products_display_price($xsell_query->fields['products_id']);
    $xsell_query->fields['products_name'] = zen_get_products_name($xsell_query->fields['products_id']);
    //$list_box_contents[$row][$col] = array('params' => 'class="centerBoxContentsCrossSell centeredContent back"' . ' ' . 'style="width:' . $col_width . '%;"',
    //'text' => '<a href="' . zen_href_link(zen_get_info_page($xsell_query->fields['products_id']), 'products_id=' . (int)$xsell_query->fields['products_id']) . '">' . zen_image(DIR_WS_IMAGES . $xsell_query->fields['products_image'], $xsell_query->fields['products_name'], SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT) . '</a><br /><a href="' . zen_href_link(zen_get_info_page($xsell_query->fields['products_id']), 'products_id=' . $xsell_query->fields['products_id']) . '">' . $xsell_query->fields['products_name'] . '</a>' . (XSELL_DISPLAY_PRICE=='true'? '<br />'.zen_get_products_display_price($xsell_query->fields['products_id']):'') );

    // bof buy now buttons
    $myBuyNow = '';
    //$flag_show_product_info_in_cart_qty = 1;

    $myBuyNow .= zen_draw_form('cart_quantity', zen_href_link(zen_get_info_page($_GET['products_id']), zen_get_all_get_params(array('action')) . 'action=add_product'), 'post', 'enctype="multipart/form-data"') . "\n";
    $myBuyNow .= 'Quantity' . '<input type="text" name="cart_quantity" value="' . (zen_get_buy_now_qty($xsell_query->fields['products_id'])) . '" maxlength="6" size="4" />' . "\n";
    //$myBuyNow .= zen_get_products_quantity_min_units_display($xsell_query->fields['products_id']) . "\n";
    $myBuyNow .= zen_draw_hidden_field('products_id', $xsell_query->fields['products_id']);
    // '<img alt="Add to cart" class="cart-add" src="' . $template->get_template_dir('my_cart_add.png', DIR_WS_TEMPLATE, $current_page_base,'images') . '/cart-add.gif" />';
    //$myBuyNow .= zen_image_submit(BUTTON_IMAGE_IN_CART, BUTTON_IN_CART_ALT);
    $myBuyNow .= zen_image_submit('button_in_cart.gif', 'Add to cart');
    $myBuyNow .= '</form>';
    //$myBuyNow .= (($flag_show_product_info_in_cart_qty == 1 and $_SESSION['cart']->in_cart($xsell_query->fields['products_id'])) ? '<p class="xsellProductsInCart">' . PRODUCTS_ORDER_QTY_TEXT_IN_CART . $_SESSION['cart']->get_quantity($xsell_query->fields['products_id']) . '</p>' : '');

    // eof buy now buttons
    $list_box_contents[$row][$col] = array('params' =>'class="grid_layout"',
    'text' => '<a class="crossSellImageLink" href="' . zen_href_link(zen_get_info_page($xsell_query->fields['products_id']), 'products_id=' . $xsell_query->fields['products_id']) . '">' . zen_image(DIR_WS_IMAGES . $xsell_query->fields['products_image'], $xsell_query->fields['products_name'], SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT) . '</a>' . "\n" .
    '<h4><a href="' . zen_href_link(zen_get_info_page($xsell_query->fields['products_id']), 'products_id=' . $xsell_query->fields['products_id']) . '">' . $xsell_query->fields['products_name'] . '</a></h4>' . "\n" .
    '<h3>' . $products_price . '</h3>' . "\n" .
    '<a class="crossSellLink" href="' . zen_href_link(zen_get_info_page($xsell_query->fields['products_id']), 'products_id=' . $xsell_query->fields['products_id']) . '">' . '[more info]' . '</a>' . "\n" .
    '<div class="crossSellBuyNow">' .
    $myBuyNow . '</div>' . "\n"
    );

    $col ++;
    if ($col > (SHOW_PRODUCT_INFO_COLUMNS_XSELL_PRODUCTS -1)) {
    $col = 0;
    $row ++;
    }
    $xsell_query->MoveNext();
    }
    // store data into array for display later where desired:
    $xsell_data = $list_box_contents;
    }
    }
    ?>

  3. #3
    Join Date
    Mar 2009
    Posts
    38
    Plugin Contributions
    0

    Default Re: Cross Sell Mod Automaticly Adding Item To Cart?

    anybody

  4. #4
    Join Date
    Mar 2009
    Posts
    38
    Plugin Contributions
    0

    Default Re: Cross Sell Mod Automaticly Adding Item To Cart?

    anyone else encounter this problem?

 

 

Similar Threads

  1. Replies: 1
    Last Post: 18 Sep 2013, 11:24 PM
  2. Fatal Error After installing Cross Sell - Just Another Cross Sell Mod
    By kconklin in forum All Other Contributions/Addons
    Replies: 7
    Last Post: 9 Jul 2010, 02:38 PM
  3. "cross sell - just another cross sell mod"
    By australican in forum All Other Contributions/Addons
    Replies: 6
    Last Post: 28 Apr 2010, 05:17 AM
  4. support for Cart Upsell/Cross Sell Mod
    By wagnerguy in forum All Other Contributions/Addons
    Replies: 0
    Last Post: 5 May 2009, 01:18 AM
  5. Cross Sell: hot ot add to cart page and show item price
    By weber in forum All Other Contributions/Addons
    Replies: 0
    Last Post: 2 Jul 2007, 11:03 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
disjunctive-egg
Zen-Cart, Internet Selling Services, Klamath Falls, OR