Results 1 to 4 of 4
  1. #1
    Join Date
    Jan 2009
    Posts
    3
    Plugin Contributions
    0

    Default Change item name of a product in the basket.

    Hi
    I want to add a product to the basket but change the product name after i click on add to cart so when the product appears in the cart it will have a different Item name.

    From what i understand I have to use observer classes to drop in my code inbetween the process from product page to cart.

    I have used the following code but not worked, either i'm using the wrong notifier or assigning the change wrong.

    Following code is located in: includes/classes/observers/class.cart_prod_change.php
    <?php
    class cart_prod_change extends base {

    function __construct()
    {
    global $zco_notifier;
    $zco_notifier->attach($this, array('NOTIFIER_CART_ADD_CART_END'));
    }

    function update(&$class, $eventID, $paramsArray = array())
    {
    $bannerdesc = "banners";
    $_SESSION['products_name'] = $bannerdesc ;
    //echo $_SESSION['products_name'];
    }
    }
    ?>


    Following code is located in: includes/auto_loaders/config.cart_prod_change.php

    <?php
    $autoLoadConfig[10][] = array('autoType'=>'class',
    'loadFile'=>'observers/class.cart_prod_change.php');
    $autoLoadConfig[90][] = array('autoType'=>'classInstantiate',
    'className'=>'cart_prod_change',
    'objectName'=>'cart_prod_change');
    ?>

    Hope someone can help i can't make heads or tails of this.

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

    Default Re: Change item name of a product in the basket.

    Why would you want the product name changed???
    Zen-Venom Get Bitten

  3. #3
    Join Date
    Jan 2009
    Posts
    3
    Plugin Contributions
    0

    Default Re: Change item name of a product in the basket.

    Hi
    Im going to have a page with where a customer enters a height and width of some material it'll calculate a cost and add it to basket. so this product can't be inputted into the database as there are infinite possibilities of size combination. when the product is added to the cart it would contain the size in the product name and the custom price will be added.

    A friend of mine has developed the same thing in wordpress with shopp plugin, and this seems to be the easiest way implement this function.

    So can anyone help me with this.

  4. #4
    Join Date
    Jul 2005
    Location
    Upstate NY
    Posts
    22,010
    Plugin Contributions
    25

    Default Re: Change item name of a product in the basket.

    I have a feeling this is going to run into continuity issues the way you are describing it. A better way might be to create a "dependent attribute" setup where the entered/selected attribute values are multiplied (by javascript) to get the product's current price. This would still require custom coding, but once done it would feed into totally stock handling. There might be unknown repercussions of doing what you originally described; only an expert could say for sure. This mod may do what you want, or at least point the way to it:
    http://www.zen-cart.com/downloads.php?do=file&id=618

 

 

Similar Threads

  1. Change Item Name and Price colour without changing product titles
    By luvvvvvit in forum Templates, Stylesheets, Page Layout
    Replies: 2
    Last Post: 29 Sep 2011, 02:32 PM
  2. align product item name to the left: how?
    By davebeing in forum Templates, Stylesheets, Page Layout
    Replies: 1
    Last Post: 17 Aug 2011, 08:16 PM
  3. Limit the size of item name column in product listing
    By safarce in forum General Questions
    Replies: 3
    Last Post: 14 Jun 2011, 08:05 PM
  4. change the shopping cart item name
    By stitchnkitty in forum Setting Up Categories, Products, Attributes
    Replies: 4
    Last Post: 30 Sep 2009, 06:03 PM
  5. want to change 'Item Name-' on product page
    By what44 in forum Templates, Stylesheets, Page Layout
    Replies: 9
    Last Post: 12 Dec 2007, 06:15 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