Results 1 to 8 of 8
  1. #1
    Join Date
    Nov 2011
    Posts
    21
    Plugin Contributions
    0

    help question Same model number, different manufacturers/products

    Continuing this thread here http://www.zen-cart.com/forum/showthread.php?t=188949

    Another problem I ran into. PartStream is working right now and it adds products to the cart.
    It generates link like this

    Code:
    index.php?action=buy_now&m=59297&arireturnurl={arireturnurl}&ariqty={aripartqty}&ariprice=76.13&aribrand=TO
    So request to ZC looks like this

    action buy_now
    m 59297
    ariqty 1
    ariprice 76.13
    aribrand TO


    m=59297 - model number
    aribrand=TO - manufacturer

    The problem is that one company(TORO) bought two others (exmark and lawn-boy) and most of the parts are having same model number, the difference is in price.
    So I have to have all parts from three "different" manufacturers in catalog, and most of them have same model numbers. I will have around 300k parts in catalog and even different parts(not just manufacturers) would have same model number.

    Here are the questions. Is there a way to make zen cart pick the product by its manufacturer AND model, not just model? What have to be done to prevent linking products if they have same model but different manufacturers. How to make abbreviations of manufacturers for aribrand, so Toro=TO, Briggs & Stratton=BRG, etc ?

    Any help would be great.

    p.s.

    I know DrByte got something to say

  2. #2
    Join Date
    Nov 2011
    Posts
    21
    Plugin Contributions
    0

    Default Re: Same model number, different manufacturers/products

    bump bump

  3. #3
    Join Date
    Nov 2011
    Posts
    21
    Plugin Contributions
    0

    Default Re: Same model number, different manufacturers/products

    Help, anybody?

  4. #4
    Join Date
    Oct 2011
    Posts
    21
    Plugin Contributions
    0

    Default Re: Same model number, different manufacturers/products

    I'm not sure if this helps but, the way I sent my cart up is by using prefixes for each manufactures so I can identify the manufacture part quickly.

    For example, the manufacture part number might be 222-010 and the manufacture is Vooloo. I will make the Vooloo prefix a "VOO".

    So the part number I enter into the zen cart database is VOO-222-010

    So with every part number normally the first 3 letters will tell me what manufacture it is just by looking at it. It makes things very simple.

    Another example. manufacture part number is 555-555. Manufacture name LETSGOO. I will them make the part number LET-555-555.

    I hope this helps.

  5. #5
    Join Date
    Nov 2011
    Posts
    21
    Plugin Contributions
    0

    Default Re: Same model number, different manufacturers/products

    force,

    Not really. ARI PartStream is separate application that I've integrated in ZC with DrByte's help. This is a tool for parts look-up and once customer found whatever he needs, he adds it to cart, partstream sends this request to ZC

    index.php?action=buy_now&m=59297&arireturnurl={arireturnurl}&ariqty={aripartqty} &ariprice=76.13&aribrand=TO

    Now, eXmark got same model number which is 59297 but the price is different and aribrand=EXM

    I can't change anything on their(partstream) side, so I have to work on Zen Cart and bend it around PartStream. I can't put TO-59297 or EXM-59297 for model number, because PartStream is requesting model and manufacturer.

    I know what I have to do, just need some help on technical part.

    -Need to define manufacturers abbreviations (Toro=TO, Exmark=EXM, etc). Probably need to add "aribrand" column to manufacturers table
    -"Turn off" linking and duplicating of products if they have same model but different manufacturers
    -Define "aribrand" in cart actions

    Because of my poor knowledge of PHP(I'm studying though), I need some help.
    Last edited by farmex; 6 Dec 2011 at 01:11 AM.

  6. #6
    Join Date
    Nov 2011
    Posts
    21
    Plugin Contributions
    0

    Default Re: Same model number, different manufacturers/products

    Here's what I got so far. I added two products with same model number, different price and name for testing.

    Here's extra cart action

    Code:
    if (isset($_GET['action']) && $_GET['action']=='buy_now' && isset($_GET['m']) && isset($_GET['aribrand']) && !isset($_GET['products_id']))
    {
      $sql= "select products_id from " . TABLE_PRODUCTS . " where products_model = :themodel:";
      $sql= "select products_id from " . TABLE_PRODUCTS . " where manufacturers_id = :brand:";
      $sql = $db->bindvars($sql, ':themodel:', $_GET['m'], 'string');
      $sql = $db->bindvars($sql, ':brand:', $_GET['aribrand'], 'string');
      $lookup = $db->Execute($sql);
      if ($lookup->RecordCount() == 1)
      {
        $_GET['products_id'] = $lookup->fields['products_id'];
    	unset($_GET['aribrand']);
    	unset($_GET['m']);
    	zen_redirect(zen_href_link($goto, zen_get_all_get_params('m')));
      }
    }
    ?>
    if I use this string

    Code:
    index.php?action=buy_now&m=aaa111sss&aribrand=17
    it adds product by its manufacturer and model. But when using other manufacturer it's not adding anything to cart

    Code:
    index.php?action=buy_now&m=aaa111sss&aribrand=4
    Another question I ran in to is, how can I define that manufacturers_id = 17 = EXM?

  7. #7
    Join Date
    Nov 2011
    Posts
    21
    Plugin Contributions
    0

    Default Re: Same model number, different manufacturers/products

    Got it working and picking product by its manufacturer and model.

    So the last question I have is how can I define that if manufacturers_id=17 it also is "EXM"


    Here's working extra cart action, if anybody would need it

    Code:
    <?php
    /**
     * Custom shopping Cart actions
     *
     * @package initSystem
     * @copyright Copyright 2003-2011 Zen Cart Development Team
     * @license http://www.zen-cart.com/license/2_0.txt GNU Public License V2.0
     */
    if (!defined('IS_ADMIN_FLAG')) {
      die('Illegal Access');
    }
    
    /**
     * check whether an "action" has been set. And if m= & aribrand= is set but no products_id is set,
     * then lookup products_id from products_model (m) and manufacturers_id (aribrand)
     */
    if (isset($_GET['action']) && $_GET['action']=='buy_now' && isset($_GET['m']) && isset($_GET['aribrand']) && !isset($_GET['products_id']))
    {
      $sql= "select products_id from " . TABLE_PRODUCTS . " where products_model = :themodel: && manufacturers_id = :brand: LIMIT 1";
      $sql = $db->bindvars($sql, ':themodel:', $_GET['m'], 'string');
      $sql = $db->bindvars($sql, ':brand:', $_GET['aribrand'], 'string');
      $lookup = $db->Execute($sql);
      if ($lookup->RecordCount() == 1)
      {
        $_GET['products_id'] = $lookup->fields['products_id'];
    	unset($_GET['aribrand']);
    	unset($_GET['m']);
    	zen_redirect(zen_href_link($goto, zen_get_all_get_params('m')));
    	zen_redirect(zen_href_link($goto, zen_get_all_get_params('aribrand')));
      }
    }
    ?>

  8. #8
    Join Date
    Nov 2011
    Posts
    21
    Plugin Contributions
    0

    Default Re: Same model number, different manufacturers/products

    It was nice talking to myself, but I figured out last question I had

    Code:
    if ($_GET['aribrand'] == TO) {$_GET['aribrand'] = 4;}
    if ($_GET['aribrand'] == EXM) {$_GET['aribrand'] = 17;}

 

 

Similar Threads

  1. How do I get the Model Number on the same line as Model??
    By MandyMac in forum Templates, Stylesheets, Page Layout
    Replies: 6
    Last Post: 28 Jul 2014, 04:27 AM
  2. Replies: 2
    Last Post: 12 Nov 2010, 11:43 PM
  3. Manufacturers Product code/model number
    By BINKOBA in forum General Questions
    Replies: 0
    Last Post: 15 Dec 2009, 05:07 AM
  4. Different Model number for different attribute
    By underworldmagic in forum Setting Up Categories, Products, Attributes
    Replies: 2
    Last Post: 25 Dec 2006, 11:05 PM
  5. Adding different model numbers on same product
    By atljar in forum Setting Up Categories, Products, Attributes
    Replies: 10
    Last Post: 18 Sep 2006, 05:09 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