Results 1 to 6 of 6
  1. #1
    Join Date
    Jan 2015
    Location
    United States
    Posts
    3
    Plugin Contributions
    0

    Default add model number in checkout and conformation page?

    how to add model number in checkout and conformation page,,i have spent hours researching this on the forum and google with no results, i took the code from main product page and placed it in the main check out page next to attributes , of coarse nothing happened ,, i have placed different parts of the code in different places in the main cart page with no results,, it seams like it would be a simple task , im missing something somewhere,, can someone help me get it to work?

  2. #2
    Join Date
    Jul 2012
    Posts
    16,734
    Plugin Contributions
    17

    Default Re: how to add model number in checkout and conformation page

    Quote Originally Posted by aatony View Post
    how to add model number in checkout and conformation page,,i have spent hours researching this on the forum and google with no results, i took the code from main product page and placed it in the main check out page next to attributes , of coarse nothing happened ,, i have placed different parts of the code in different places in the main cart page with no results,, it seams like it would be a simple task , im missing something somewhere,, can someone help me get it to work?
    Generally also need to look in the files loaded in the pages directory for the page you want the data. So for example, the shopping cart page you would look at includes/modules/pages/shopping_cart directory, and see header_php.php and I think a javascript file... Suggest looking at/editing the header_php.php file, though it may also be that you've turned off some option in the admin panel to hide that information from those pages.... Check the product type info under the catalog drop down, also the layout settings in the configuration dropdown, and the others there as well.
    ZC Installation/Maintenance Support <- Site
    Contribution for contributions welcome...

  3. #3
    Join Date
    Sep 2003
    Location
    Ohio
    Posts
    69,402
    Plugin Contributions
    6

    Default Re: how to add model number in checkout and conformation page

    You could customize the template file using your templates and overrides for:
    /includes/templates/template_default/templates/tpl_checkout_confirmation_default.php

    and copy it to:
    /includes/templates/your_template_dir/templates/tpl_checkout_confirmation_default.php

    and add the code in RED:
    Code:
              <td class="cartProductDisplay"><?php echo $order->products[$i]['name'] . ' - ' . $order->products[$i]['model']; ?>
    Linda McGrath
    If you have to think ... you haven't been zenned ...

    Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!

    Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today: v1.5.5]
    Officially PayPal-Certified! Just click here

    Try our Zen Cart Recommended Services - Hosting, Payment and more ...
    Signup for our Announcements Forums to stay up to date on important changes and updates!

  4. #4
    Join Date
    Jan 2007
    Location
    Australia
    Posts
    6,167
    Plugin Contributions
    7

    Default Re: add model number in checkout and conformation page?

    Quote Originally Posted by aatony View Post
    how to add model number in checkout and conformation page,
    Adding this to the confirmation page is pretty straightforward.

    Which other of the 'checkout' page(s) do you wish this to been seen. If it's the checkout success page then that is a *little* more difficult, but perhaps you are thinking of another page entirely?

    Quote Originally Posted by aatony View Post
    ,i have spent hours researching this on the forum and google with no results, i took the code from main product page and placed it in the main check out page next to attributes , of coarse nothing happened ,, i have placed different parts of the code in different places in the main cart page with no results,, it seams like it would be a simple task , im missing something somewhere,, can someone help me get it to work?
    OK, for the confirmation page.

    The file to edit is /includes/templates/YOUR_TEMPLATE/templates/tpl.checkout _confirmation.php

    Look for the code that reads like:

    Code:
    <?php // now loop thru all products to display quantity and price ?>
    <?php for ($i=0, $n=sizeof($order->products); $i<$n; $i++) { ?>
            <tr class="<?php echo $order->products[$i]['rowClass']; ?>">
              <td  class="cartQuantity"><?php echo $order->products[$i]['qty']; ?>&nbsp;x</td>
              <td class="cartProductDisplay"><?php echo $order->products[$i]['name']; ?>
              <?php  echo $stock_check[$i]; ?>
    Add a new line, so it reads:

    Code:
    <?php // now loop thru all products to display quantity and price ?>
    <?php for ($i=0, $n=sizeof($order->products); $i<$n; $i++) { ?>
            <tr class="<?php echo $order->products[$i]['rowClass']; ?>">
              <td  class="cartQuantity"><?php echo $order->products[$i]['qty']; ?>&nbsp;x</td>
              <td class="cartProductDisplay"><?php echo $order->products[$i]['name']; ?>
                        <?php echo $order->products[$i]['model']; ?>      
              <?php  echo $stock_check[$i]; ?>
    You may also wish to place this into its own <td class> for formatting purposes.
    Save the file and you're done.

    To have this displayed on the checkout success page (where by default they are shown only as part of the 'Please notify me of updates to these products' you need to *either* replicate this loop part of the code and add it to the checkout success page, OR, you could opt to just add the model number to the notification list.
    To add it to the notification list you'll need to edit
    /includes/modules/pages/account_notifications/header_php.php and modify the search query

    Code:
    $products_query = "SELECT pd.products_id, pd.products_name
                       FROM   " . TABLE_PRODUCTS_DESCRIPTION . " pd,
                              " . TABLE_PRODUCTS_NOTIFICATIONS . " pn
                       WHERE  pn.customers_id = :customersID
                       AND    pn.products_id = pd.products_id
                       AND    pd.language_id = :languagesID
                       ORDER BY pd.products_name";
    
    
    $products_query = $db->bindVars($products_query, ':customersID',$_SESSION['customer_id'], 'integer');
    $products_query = $db->bindVars($products_query, ':languagesID',$_SESSION['languages_id'], 'integer');
    $products = $db->Execute($products_query);
    while (!$products->EOF) {
      $notificationsArray[] = array('counter'=>$counter,
                                    'products_id'=>$products->fields['products_id'],
                                    'products_name'=>$products->fields['products_name']);
      $counter++;
      $products->MoveNext();
    }
    ... so that it includes the model number. To do this though you'll need to add a 'join' to the query (or create another query) to retrieve the model number from the 'products' table and add this to the $notificationsArray[], either by concating it to one of the exiting fields, or by creating a new field and then making changes to the checkout_success page so that it outputs this additional data field. As I said, its not quite as easy as the change needed for the confirmation page.

    Since I'm not sure that this is the actual page you are thinking of though I've left it up to you to fill in the exact detail. :)

    Cheers
    RodG

  5. #5
    Join Date
    Jan 2015
    Location
    United States
    Posts
    3
    Plugin Contributions
    0

    Default Re: add model number in checkout and conformation page?

    ok Rodg,, dude your code worked on the conformation page, i could not have done that without you,,thanks alot,,, i have tried the code on the main checkout page but cant seam to get it to work,, the main checkout page for me is just as important as the conformation page, can you help me on that issue,,
    my logic tells me that zen should include something like that in the main code by defalt,, model or SKU is important

  6. #6
    Join Date
    Jan 2015
    Location
    United States
    Posts
    3
    Plugin Contributions
    0

    Default Re: add model number in checkout and conformation page?


 

 

Similar Threads

  1. v139f How to add "Model" infront of my model number above my product pictures?
    By missymissy in forum Templates, Stylesheets, Page Layout
    Replies: 9
    Last Post: 15 Apr 2014, 06:44 AM
  2. Add Model Number to Specials Page
    By aimwilk in forum Templates, Stylesheets, Page Layout
    Replies: 9
    Last Post: 9 Oct 2013, 03:14 AM
  3. Google Checkout Query - Add Model Number Field
    By da-design in forum Addon Payment Modules
    Replies: 1
    Last Post: 1 Nov 2012, 10:51 AM
  4. display model number on side box and main page
    By nishajh in forum General Questions
    Replies: 0
    Last Post: 17 Jun 2009, 06:27 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