Page 1 of 2 12 LastLast
Results 1 to 10 of 16
  1. #1
    Join Date
    Sep 2006
    Posts
    9
    Plugin Contributions
    0

    Default how to show product links on confirmation page?

    Hi DrByte,

    How you doing? i want to show products url in the checkout confirmation page.

    i do not mean descriptive page urls,i mean "more info page urls".

    I know products url will be in the products_description table in SQL.

    I have checked it.

    But i do not know the code to call that url in the checkout confirmation page.

    i wanna show order quantity, products name ,price and also product url.

    could you help me in this?

    if you can give me the code,i can write it at tpl_checkout_confirmation_default.php.

    iam new to php and sql.please give me the code .

    Thank you very much

    Jeethoo
    Last edited by making_web2002; 29 Sep 2006 at 05:48 PM.

  2. #2
    Join Date
    Sep 2006
    Posts
    9
    Plugin Contributions
    0

    Default Re: how to show product links on confirmation page?

    can anyone help me ?

    Thanks
    Jeethoo

  3. #3
    Join Date
    Sep 2006
    Posts
    9
    Plugin Contributions
    0

    Default Re: how to show product links on confirmation page?

    can anyone comeup with an idea?

    i have been trying and trying ...but unsuccessful.

    Thanks
    Jeethoo

  4. #4
    Join Date
    Feb 2006
    Location
    Chicago
    Posts
    1,162
    Plugin Contributions
    0

    Default Re: how to show product links on confirmation page?

    Quote Originally Posted by making_web2002
    can anyone comeup with an idea?

    i have been trying and trying ...but unsuccessful.

    Thanks
    Jeethoo
    What did you try till now?
    Tutorials on Zen Cart
    http://tutorials.zen-cart.com/index.php
    ---------------
    advanced.programmer at gmail dot com
    In love with Zen Cart!!

  5. #5
    Join Date
    Sep 2006
    Posts
    9
    Plugin Contributions
    0

    Default Re: how to show product links on confirmation page?

    Quote Originally Posted by superprg
    What did you try till now?
    here i will explain you what i did.

    visitor after coming to confirmation page,he sees his order details.let say he order sony camc one unit for $299.99.

    what he sees here is

    Qty. Item Name Total
    1 X sony cam 299.99

    when i go to the source of the confirmation page,i have seen these are retrived from the TABLE_ORDERS_PRODUCTS .(this work is done by includes/classes/order.php)

    in the confirmation source i have seen there is a loop, in the case the visitor order more products i.e different kind products.

    he loop will work to retrieve all product names and qty and total.

    uptill here everything is fine.

    in this loop i entered this code <?php

    echo $order->url[$i]['products_url'];

    ?>

    The above code will try to contact the order.php where i have written another code which will contact the TABLE_PRODUCTS_DESCRIPTION to get the products_url.

    here is that code which i have written.

    (the bellow code should be in includes/classes/order.php)

    i am pasting all the code here the red color one is i have newely written.i am shortening the code,because this form is not allow too long message


    <?php

    function order($order_id = '') {
    $this->info = array();
    $this->totals = array();
    $this->products = array();
    $this->customer = array();
    $this->delivery = array();
    $this->url = array();

    code will go on ,nothing chaged here-------------uptill the below.

    $orders_products_query = "select orders_products_id, products_id, products_name,
    products_model, products_price, products_tax,
    products_quantity, final_price,
    onetime_charges,
    products_priced_by_attribute, product_is_free, products_discount_type,
    products_discount_type_from
    from " . TABLE_ORDERS_PRODUCTS . "
    where orders_id = '" . (int)$order_id . "'";

    $orders_products = $db->Execute($orders_products_query);



    $orders_url_query = "select products_url from " . TABLE_PRODUCTS_DESCRIPTION . " where products_name = '" . $orders_products->fields['products_name'] . "'";

    $orders_url = $db->Execute($orders_url_query);


    while (!$orders_products->EOF) {
    // convert quantity to proper decimals - account history
    if (QUANTITY_DECIMALS != 0) {
    $fix_qty = $orders_products->fields['products_quantity'];
    switch (true) {
    case (!strstr($fix_qty, '.')):
    $new_qty = $fix_qty;
    break;
    default:
    $new_qty = preg_replace('/[0]+$/', '', $orders_products->fields['products_quantity']);
    break;
    }
    } else {
    $new_qty = $orders_products->fields['products_quantity'];
    }

    $new_qty = round($new_qty, QUANTITY_DECIMALS);

    if ($new_qty == (int)$new_qty) {
    $new_qty = (int)$new_qty;
    }

    $this->products[$index] = array('qty' => $new_qty,
    'id' => $orders_products->fields['products_id'],
    'name' => $orders_products->fields['products_name'],
    'model' => $orders_products->fields['products_model'],
    'tax' => $orders_products->fields['products_tax'],
    'price' => $orders_products->fields['products_price'],
    'final_price' => $orders_products->fields['final_price'],
    'onetime_charges' => $orders_products->fields['onetime_charges'],
    'products_priced_by_attribute' => $orders_products->fields['products_priced_by_attribute'],
    'product_is_free' => $orders_products->fields['product_is_free'],
    'products_discount_type' => $orders_products->fields['products_discount_type'],
    'products_discount_type_from' => $orders_products->fields['products_discount_type_from']);

    $subindex = 0;

    $this->url[$index] = array('products_url' => $orders_url->fields['products_url']);
    $subindex = 0;


    $attributes_query = "select products_options_id, products_options_values_id, products_options, products_options_values,
    options_values_price, price_prefix from " . TABLE_ORDERS_PRODUCTS_ATTRIBUTES . "
    where orders_id = '" . (int)$order_id . "'
    and orders_products_id = '" . (int)$orders_products->fields['orders_products_id'] . "'";

    code goes on uptill the end


    ------

    after i have done this ,nothing is showing up in the confirmation page.

    any help?

    thanks
    jeethoo

  6. #6
    Join Date
    Feb 2006
    Location
    Chicago
    Posts
    1,162
    Plugin Contributions
    0

    Default Re: how to show product links on confirmation page?

    Let me get back to you after trying this
    San
    Tutorials on Zen Cart
    http://tutorials.zen-cart.com/index.php
    ---------------
    advanced.programmer at gmail dot com
    In love with Zen Cart!!

  7. #7
    Join Date
    Jan 2004
    Posts
    66,443
    Plugin Contributions
    279

    Default Re: how to show product links on confirmation page?

    Here's the fastest way to do it without affecting core code:

    new file:
    /includes/functions/extra_functions/myfunctions.php
    PHP Code:
    <?php 
      
    function zen_get_products_url($product_id$language '') {
        global 
    $db;
        if (empty(
    $language)) $language $_SESSION['languages_id'];
        
    $product_query "select products_url
                          from " 
    TABLE_PRODUCTS_DESCRIPTION "
                          where products_id = '" 
    . (int)$product_id "'
                          and language_id = '" 
    . (int)$language "'";
        
    $product $db->Execute($product_query);
        if (
    $product->fields['products_url'] == '') return false;
        
    $url zen_href_link(FILENAME_REDIRECT'action=url&goto=' urlencode($product->fields['products_url']), 'NONSSL'truefalse);
        return 
    '<a href="' $url '" target="_blank">' MORE_INFO_TEXT '</a>';
      }

    ?>
    Now edit your checkout-confirmation template:
    /includes/templates/YOURTEMPLATE/templates/tpl_checkout_confirmation_default.php
    around line 134 you have this:
    Code:
              <?php  echo $stock_check[$i]; ?>
    add this below it:
    Code:
              <?php if ($disp_url = zen_get_products_url($order->products[$i]['id']) )  echo '<br />' . $disp_url; ?>
    .

    Zen Cart - putting the dream of business ownership within reach of anyone!
    Donate to: DrByte directly or to the Zen Cart team as a whole

    Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
    Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

  8. #8
    Join Date
    Sep 2006
    Posts
    9
    Plugin Contributions
    0

    Default Re: how to show product links on confirmation page?

    Quote Originally Posted by DrByte
    Here's the fastest way to do it without affecting core code:

    new file:
    /includes/functions/extra_functions/myfunctions.php
    PHP Code:
    <?php 
      
    function zen_get_products_url($product_id$language '') {
        global 
    $db;
        if (empty(
    $language)) $language $_SESSION['languages_id'];
        
    $product_query "select products_url
                          from " 
    TABLE_PRODUCTS_DESCRIPTION "
                          where products_id = '" 
    . (int)$product_id "'
                          and language_id = '" 
    . (int)$language "'";
        
    $product $db->Execute($product_query);
        if (
    $product->fields['products_url'] == '') return false;
        
    $url zen_href_link(FILENAME_REDIRECT'action=url&goto=' urlencode($product->fields['products_url']), 'NONSSL'truefalse);
        return 
    '<a href="' $url '" target="_blank">' MORE_INFO_TEXT '</a>';
      }

    ?>
    Now edit your checkout-confirmation template:
    /includes/templates/YOURTEMPLATE/templates/tpl_checkout_confirmation_default.php
    around line 134 you have this:
    Code:
              <?php  echo $stock_check[$i]; ?>
    add this below it:
    Code:
              <?php if ($disp_url = zen_get_products_url($order->products[$i]['id']) )  echo '<br />' . $disp_url; ?>


    After writing this code in the includes/functions/extra_functions/myfunctions.php,

    iam getting the bellow error on each page while i browse including home page.


    this bellow error is show very starting of the page.

    here is the error.

    Warning: session_start(): Cannot send session cookie - headers already sent by (output started at /home/jeethoo/public_html/store/includes/functions/extra_functions/myfunctions.php:18) in /home/ajit123/public_html/store/includes/functions/sessions.php on line 100

    Warning: session_start(): Cannot send session cache limiter - headers already sent (output started at /home/jeethoo/public_html/store/includes/functions/extra_functions/myfunctions.php:18) in /home/ajit123/public_html/store/includes/functions/sessions.php on line 100

    Warning: Cannot modify header information - headers already sent by (output started at /home/jeethoo/public_html/store/includes/functions/extra_functions/myfunctions.php:18) in /home/jeethoo/public_html/store/includes/init_includes/init_templates.php on line 78


    -----------

    if the visitor come to the site and add the products to cart and login ,there are even more such errors are seen.

    can you please tell me how to rectify this error.

    my zen version 1.3.0.2

    Thanks
    Jeethoo

  9. #9
    Join Date
    Feb 2006
    Location
    Chicago
    Posts
    1,162
    Plugin Contributions
    0

    Default Re: how to show product links on confirmation page?

    In your myfunctions.php make sure that you dont have anything before
    <?php

    and anything after ?>

    San
    Tutorials on Zen Cart
    http://tutorials.zen-cart.com/index.php
    ---------------
    advanced.programmer at gmail dot com
    In love with Zen Cart!!

  10. #10
    Join Date
    Sep 2006
    Posts
    9
    Plugin Contributions
    0

    Default Re: how to show product links on confirmation page?

    Quote Originally Posted by superprg
    In your myfunctions.php make sure that you dont have anything before
    <?php

    and anything after ?>

    San
    Yes nothing is there after and before that code.i even deleted free space and tried.But still same problem.

    any help?

    Thanks
    Jeethoo

 

 
Page 1 of 2 12 LastLast

Similar Threads

  1. v154 how to show bloc category on product page?
    By Autoprestige-tuning in forum Templates, Stylesheets, Page Layout
    Replies: 5
    Last Post: 30 Nov 2015, 05:05 PM
  2. Replies: 2
    Last Post: 24 Apr 2012, 11:25 AM
  3. how to make a product page show as home page?
    By gnuzoo in forum Setting Up Categories, Products, Attributes
    Replies: 6
    Last Post: 3 Nov 2009, 08:38 PM
  4. Product Page: Show Links to Categories where it also resides?
    By wokka in forum Setting Up Categories, Products, Attributes
    Replies: 0
    Last Post: 22 Jun 2008, 12:20 PM
  5. how do i remove all links to end product info page on multi product page?
    By what44 in forum Templates, Stylesheets, Page Layout
    Replies: 2
    Last Post: 6 Nov 2007, 06:10 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