Results 1 to 2 of 2
  1. #1
    Join Date
    Sep 2010
    Location
    Australia
    Posts
    11
    Plugin Contributions
    0

    Default Shopping Cart Product Item External Page URL

    Hello Forum,

    I am working on a website that has custom, external product pages. When products are added to the cart, the default link is to the Zen Cart product page for that particular product item (for all good reasons).

    I'd like to (if possible) to change this default url linking to it's custom page. The url for the custom page is defined in the MySql table;

    products_description

    In the field;

    products_url


    From the, tpl_shopping_cart_default.php, code the, foreach ($productArray as $product), array doesn't have the products url defined as an element within it so the,

    <a href="<?php echo $product['linkProductsName']; ...

    Cannot be altered with any item/value within the array. Is there anyway I can add a key such that;

    productExternalPageUrl => assigned as the products_description.products_url value

    to the $productArray above.

    Thanks and regards,
    - BotRot

  2. #2
    Join Date
    Sep 2010
    Location
    Australia
    Posts
    11
    Plugin Contributions
    0

    Default Re: Shopping Cart Product Item External Page URL

    OK for those of you out there that want to know how to do this, or have a customer that insists that their product items in their shopping cart, link to their external (very pretty) pages, here is how. First implement this at your own volition, I can't assure you I can answer all questions regarding this, or know of contingencies in Zen Cart I may have neglected by the virtue of my own ignorance. Here we go;

    First
    -----
    Make sure your products have a product url either, set using the Product\Category in the admin, or in the products_description table, products_url field.


    Second
    ---------
    includes/classes/shopping_cart.php

    Line 1074 (in my case), add the following to the sql statement, pd.products_url
    Line 1210 (in my case), add the following to the array, ,'purl' => $products->fields['products_url']

    Third
    ------
    includes/modules/pages/shopping_cart/header_php.php

    Line 85 (in my case), add the following variable assignment, $productsURL = $products[$i]['purl'];
    Line 168 (in my case), add the following array key/value, ,'productURL' => $productsURL

    Then
    -----
    includes/templates/template_default/templates/tpl_shopping_cart_default.php

    Find the line that has;
    <a href="<?php echo $product['linkProductsName']; ?>"><span id="cartImage"...

    and change 'linkProductsName', to 'productsURL'.

    Hope this can help out someone else too, then it was really worth it.

    Thanks and regards,
    - BotRot

 

 

Similar Threads

  1. Can I include external data via ajax in my shopping cart page?
    By tiffbrink in forum General Questions
    Replies: 1
    Last Post: 26 Feb 2013, 08:32 PM
  2. adding item to shopping cart takes me to item search page
    By knight74 in forum Templates, Stylesheets, Page Layout
    Replies: 3
    Last Post: 10 Aug 2010, 06:07 AM
  3. Adding Product to cart from external page
    By Cylants in forum Setting Up Categories, Products, Attributes
    Replies: 1
    Last Post: 12 Jun 2009, 05:07 PM
  4. Shopping Cart Item URL's
    By emaugust in forum General Questions
    Replies: 0
    Last Post: 18 May 2009, 06:20 AM
  5. Attribute String in Shopping Cart Product URL
    By voltage in forum Basic Configuration
    Replies: 1
    Last Post: 23 Jul 2006, 03:29 AM

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