Results 1 to 9 of 9
  1. #1
    Join Date
    Feb 2008
    Posts
    569
    Plugin Contributions
    0

    Default Arrange this coding

    Hello I have been trying to get the following code into divs but I cant get it to work properly....
    I am looking to get it to
    #leftcrosscell : Title & Image
    #centralcrosscell : Price
    #rightcrosscell : QTY Box
    If someone can help me with this it would be greatly appreciated!

    PHP Code:
    <link href="includes/templates/mytemplate/xcross.css" rel="stylesheet" type="text/css" />
    <?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 ) {
      
    $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 .= 'QTY:' '<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 .= (($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_WIDTHSMALL_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;
      }
    }
    ?>
    Attached stylesheet
    PHP Code:
    #leftcrosscell {
    floatleft;
    width180px;
    height565px;
    margin-left2px !important;
    margin-left1px;
    padding2px;
    background#f4f4f0;
    border1px solid #777744;
    }
    #centralcrosscell {
    floatleft;
    width384px;
    height565px;
    margin0 2px;
    padding2px;
    border1px solid #777744;
    }
    #rightcrosscell {
    floatleft;
    width180px;
    height565px;
    padding2px;
    background#f4f4f0;
    border1px solid #777744;


  2. #2
    Join Date
    Aug 2005
    Location
    Arizona
    Posts
    27,755
    Plugin Contributions
    9

    Default Re: Arrange this coding

    First no need to inline style/call the stylesheet
    ZenCart loads all stylesheets in order to their name
    You could just include wht you have in the standard stylesheet.css file

    A link to your site would allow the many here to assist
    Zen-Venom Get Bitten

  3. #3
    Join Date
    Feb 2008
    Posts
    569
    Plugin Contributions
    0

    Default Re: Arrange this coding

    the test site is here with this mod, I dont have it on the actual site until I get it working properly
    http://www.pe**tla**ndp**lus.com/tes...06b9a26eee9c66

    no **

    Thank you

  4. #4
    Join Date
    Feb 2008
    Posts
    569
    Plugin Contributions
    0

    Default Re: Arrange this coding

    everytime i try to insert a div where I think it belongs then the mod won't show up on the product page so Im doing something wrong.

  5. #5
    Join Date
    Oct 2006
    Location
    Alberta, Canada
    Posts
    4,571
    Plugin Contributions
    1

    Default Re: Arrange this coding

    Your problems start on line 354 of your output:
    <link href="xcross.css" rel="stylesheet" type="text/css" />

    Remove that line of code and rename your 'xcross.css' to 'stylesheet_xcross.css'. Zen Cart will then load it automatically.

    Next, you have a FORM starting at line 364 which is not closed.

    Edit whatever file has:

    <!-- xsell_products //-->
    <!-- bof: tpl_modules_xsell_products -->

    and add </form> before these two lines:

    </div>
    <br class="clearBoth" />

  6. #6
    Join Date
    Feb 2008
    Posts
    569
    Plugin Contributions
    0

    Default Re: Arrange this coding

    Thanks website rob, the mod is working how it is, i have fixed some of what you said.
    But still isn't fixing what I am asking.
    I am using the "another cross sell mod". I am trying to customize the layout into three different sections, i have made a rough draft of a picture of what I am trying to explain. Thank you for helping me out!
    Attached Images Attached Images  

  7. #7
    Join Date
    Nov 2007
    Location
    Melbourne, Australia
    Posts
    541
    Plugin Contributions
    0

    Default Re: Arrange this coding

    On your draft there is a add to cart button, where customers can add the selected recommended product to the shopping cart. Mayb use a add to cart button for each product without a quantity box instead.

  8. #8
    Join Date
    Feb 2008
    Posts
    569
    Plugin Contributions
    0

    Default Re: Arrange this coding

    I think there is a misunderstanding, everything is working perfect, the add to cart button is functioning for the products listing in the cross sell, I just want to change the layout thats all. I want it to be left to right horizontal instead of verticle. I have tried to put it in a 3 column table but didn't work and I also tried to put it in 3 different divs but I cannot seem to position the divs in the correct location for it to work.

  9. #9
    Join Date
    Feb 2008
    Posts
    569
    Plugin Contributions
    0

    Default Re: Arrange this coding

    I solved it I will be posting me results after I fix it up. Thanks!

 

 

Similar Threads

  1. v139h how to do this custom coding?
    By linjuming in forum General Questions
    Replies: 10
    Last Post: 10 May 2012, 04:43 AM
  2. How to tidy this up (re-arrange things)?
    By pb4 in forum Templates, Stylesheets, Page Layout
    Replies: 4
    Last Post: 7 Apr 2010, 05:07 PM
  3. Help me with this HTML coding for Sponser Box
    By wmorris in forum General Questions
    Replies: 3
    Last Post: 20 Feb 2008, 11:31 PM
  4. can't find this coding
    By julia44 in forum Templates, Stylesheets, Page Layout
    Replies: 4
    Last Post: 28 Dec 2006, 09:26 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