Results 1 to 2 of 2
  1. #1
    Join Date
    Feb 2009
    Posts
    88
    Plugin Contributions
    1

    help question Does the notifier support changing Product Names as they go into the Cart, or Order?

    I have developed a 'spare parts' system for our online shop, at http://www.premierrange.co.uk/index....in_page=spares. I'm a pretty capable developer and have been working with ZC for 2 or 3 years now.

    Each spare part is an individual product, e.g. products_id = 123 and has a simple name like products_name = 'Glass Canopy'. A more useful product name can be generated by some custom lookups in our database to include the spare part category tree it's in, e.g. "H76 -> 60cm -> Stainless Steel -> Glass Canopy".

    http://www.premierrange.co.uk/index....roducts_id=278

    A quick fix would be to simply store more detailed product names, e.g zen_products_description.products_name = 'H76 -> 60cm -> Stainless Steel -> Glass Canopy' .. I could work around the problems this causes when I need to show just "Glass Canopy" (e.g. on the spares diagram page http://www.premierrange.co.uk/index....cat_path=1_2_6) .. but I'd really like to use the observer system, if possible.

    I want to be able to modify the products_name that's put into the Order. Preferably, it should also modify the name seen in the Shopping Cart. So the products_name stays as 'Glass Canopy' in the zen_products_description table, but when you click Add To Cart, you see "H76 -> 60cm -> Stainless Steel -> Glass Canopy" and that's what appears on the order too.

    In this way, the customer sees a short name like 'Glass Canopy', and our back office staff see a detailed name that they need to pick the correct item.

    1/ for the shopping cart:
    I can see that the shopping_cart.php code only stores the products_id, so it only knows which product is in the cart, not its name. The Shopping Cart page gets the name during modules/pages/shopping_cart/header_php.php and only uses it for one-time rendering on the cart page.

    I cannot see any notifier/observer hooks in this code. Is it possible to use an observer to modify the product names seen on the Shopping Cart or would we have to hack the core files?

    2/ for the order:
    And, the order.php code also does not extract the products_name during initialisation - pages/checkout_confirmation/header_php.php creates $order = new order() which would run $order->cart() and only store the products_id in memory. It's not until checkout_process.php is run that $order->create_add_products is run and the products_name is ripped from zen_products_description straight into zen_order without being seen by the user.

    It seems that when the the order is committed to the database, I could use NOTIFY_ORDER_DURING_CREATE_ADDED_ATTRIBUTE_LINE_ITEM (per product in the order) or NOTIFY_CHECKOUT_PROCESS_AFTER_ORDER_CREATE_ADD_PRODUCTS (for post processing the whole order) to modify the product names in the order table. This would be a rather late stage, but would at least make the more specific name visible to our back office staff.

    What would you recommend?

    This may be related to this recent post, but I didn't want to jump in there if it's unrelated:
    http://www.zen-cart.com/forum/showthread.php?t=182403

    Thanks
    Nick

  2. #2
    Join Date
    Jan 2004
    Posts
    66,373
    Blog Entries
    7
    Plugin Contributions
    274

    Default Re: Does the notifier support changing Product Names as they go into the Cart, or Ord

    Have you explored using the NOTIFIER_CART_GET_PRODUCTS_END notifier point?
    .

    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.

 

 

Similar Threads

  1. v138a Once they click on the "Comfirm the Order" the hit it twice
    By willweC in forum PayPal Website Payments Pro support
    Replies: 2
    Last Post: 2 Apr 2014, 07:33 PM
  2. Changing the names of the links in INFORMATION sidebox
    By luke_pickering in forum Templates, Stylesheets, Page Layout
    Replies: 1
    Last Post: 8 Jan 2011, 01:02 PM
  3. Changing The Link Names in the INFORMATION box
    By allenrubin in forum Basic Configuration
    Replies: 1
    Last Post: 23 Jan 2010, 04:47 AM
  4. Changing the size of Category and Product names?
    By autoace in forum Setting Up Categories, Products, Attributes
    Replies: 2
    Last Post: 10 Sep 2009, 04:10 PM
  5. changing 'New product's for the month' into an image?
    By R-Lo in forum Templates, Stylesheets, Page Layout
    Replies: 2
    Last Post: 13 Feb 2008, 08:22 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