Page 1 of 5 123 ... LastLast
Results 1 to 10 of 42
  1. #1
    Join Date
    May 2007
    Posts
    36
    Plugin Contributions
    0

    cart error Cross Sell Module Mods

    Hi there,

    I've currently got the Cross Sell module installed and i'm using the other module to get them to show up on the checkout page. I'm very happy with this and it's working well........

    But at the moment the cross sell only shows the product image, product name and price. I'd like to get it to show an "add to cart" button as well.

    If anyone can help me with how to do this i would be very thankful

    Cheers, ToNy!

  2. #2
    Join Date
    May 2007
    Posts
    36
    Plugin Contributions
    0

    Default Re: Cross Sell Module Mods

    Bump!!! Can anyone help out with this? Dr Byte?

  3. #3
    Join Date
    Oct 2006
    Posts
    5,477
    Plugin Contributions
    11

    Default Re: Cross Sell Module Mods

    You will have to dig in the code, and make changes: make changes in the module and template file (for the checkout page). This is not some thing extremely hard, but it's not something that can be done with a few lines of codes.
    I no longer provide installation support on forum for all my modules. However, if there are real bugs with the modules please feel free to contact me

  4. #4
    Join Date
    Nov 2003
    Posts
    1,987
    Plugin Contributions
    15

    Default Re: Cross Sell Module Mods

    The code below is an example, it does work but please don't use it "out of the box" (a.o. because some texts are harcoded and it will mess up your current cross sell layout).

    It includes:

    - Buy Now buttons
    - More Info links
    - a quantity input field
    - quantity in cart display (optional)

    includes\modules\YOUR_TEMPLATE\xsell_products.php (it's an example of the the module file only):
    Code:
    <?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($xsell_query->fields['products_id']), zen_get_all_get_params(array('action')) . 'action=add_product'), 'post', 'enctype="multipart/form-data"') . "\n";
    $myBuyNow .= 'Aantal' . '<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="Aan winkelwagen toevoegen" 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('my_cart_add.png', 'Voeg toe aan winkelwagen.');
    $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']) . '">' . '[meer 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;
      }
    }
    ?>
    The changes are (partly?) commented by "// bof buy now buttons" and "// eof buy now buttons"

  5. #5
    Join Date
    Nov 2003
    Posts
    1,987
    Plugin Contributions
    15

    Default Re: Cross Sell Module Mods

    Bug fix:

    This (code from my previous post)
    Code:
    $myBuyNow .= zen_draw_form('cart_quantity', zen_href_link(zen_get_info_page($xsell_query->fields['products_id']), zen_get_all_get_params(array('action')) . 'action=add_product'), 'post', 'enctype="multipart/form-data"') . "\n";
    Should be:
    Code:
    $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";
    It's an issue only if an xsell master has another products type than it's xsell products.

  6. #6
    Join Date
    Nov 2007
    Posts
    4
    Plugin Contributions
    0

    Default Re: Cross Sell Module Mods

    Hello, sorry for my english, i'm french.

    I use zencart and cross sell to make link on a product to another product.
    But I want to make another thing :

    An exemple :

    Supposing I cross sell product A with product B.
    I want, when the customer buy product A AND product B, apply a reduction (like 10% for exemple). Is it possible with the basic version of cross sell, or had I to develop it ?


    Thanks for your answers, Damien

  7. #7
    Join Date
    Oct 2006
    Posts
    5,477
    Plugin Contributions
    11

    Default Re: Cross Sell Module Mods

    I think you need to look at the Better Together mod.
    I no longer provide installation support on forum for all my modules. However, if there are real bugs with the modules please feel free to contact me

  8. #8
    Join Date
    Nov 2007
    Posts
    4
    Plugin Contributions
    0

    Default Re: Cross Sell Module Mods

    Yes, but my exemple is not good in fact... better together is to link two products, and me, I wan't like, two, three, four... products

  9. #9
    Join Date
    Apr 2006
    Location
    London, UK
    Posts
    10,569
    Plugin Contributions
    25

    Default Re: Cross Sell Module Mods

    Il n’y a pas de moyen en Zen Cart standard pour créer une liaison entre des produits multiples, ce que j’ai appelé d’ailleurs le « product bundle ». Cependant, si vous connaissez un peu de PHP, grâce à « extra_cart_actions», vous pouvez effectuer une remise sur une collection de produits qui sont déterminée en avance. Voyez ici plus d’informations.
    Kuroi Web Design and Development | Twitter

    (Questions answered in the forum only - so that any forum member can benefit - not by personal message)

  10. #10
    Join Date
    Nov 2007
    Posts
    4
    Plugin Contributions
    0

    Default Re: Cross Sell Module Mods

    Merci beaucoup je file voir ça


    <edit>

    Très intéressant votre lien. Il faut que je trouve le moyen de passer par une page temporaire permettant le choix des attributs du produit. Je vais reflechir à ça

    </edit>
    Last edited by neojick; 8 Nov 2007 at 02:41 PM.

 

 
Page 1 of 5 123 ... LastLast

Similar Threads

  1. Which one? Multi Cross Sell vs Ultimate Cross Sell?
    By Renz in forum All Other Contributions/Addons
    Replies: 2
    Last Post: 3 Jul 2013, 08:30 AM
  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 Module
    By Drunkguy in forum Templates, Stylesheets, Page Layout
    Replies: 0
    Last Post: 12 Mar 2010, 08:09 AM
  4. Cross Sell and Advanced Cross Sell Modules
    By fairway in forum Addon Templates
    Replies: 4
    Last Post: 8 Dec 2009, 08:44 PM

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