Results 1 to 6 of 6
  1. #1
    Join Date
    Jan 2012
    Posts
    59
    Plugin Contributions
    0

    Default accessing product pages with products_model and products_id

    I have found this old thread http://www.zen-cart.com/forum/showthread.php?t=66448

    and it is exactly what I want to do but unfortunately the link that gives the information on which file to put the code in is broken...
    where would the code snippet from that thread be placed in order for it to work?

    PHP Code:
    if (!isset($_GET['products_id']) && isset($_GET['products_model'])) {
        
    $_GET['products_model'] = zen_db_prepare_input($_GET['products_model']);
        
    $get_products_id $db->Execute("SELECT products_id FROM " TABLE_PRODUCTS " WHERE products_model='" zen_db_input($_GET['products_model']) . "' LIMIT 1");
        if(
    $get_products_id->EOF)
          
    $_GET['products_id'] = 0;
        else
          
    $_GET['products_id'] = $get_products_id->fields['products_id'];
      } 
    thanks,
    Will

  2. #2
    Join Date
    Apr 2009
    Posts
    2,134
    Plugin Contributions
    3

    Default Re: accessing product pages with products_model and products_id

    I'd try the top of

    includes/modules/pages/product_info/header_php.php

    just below the notifier.

  3. #3
    Join Date
    Jan 2012
    Posts
    59
    Plugin Contributions
    0

    Default Re: accessing product pages with products_model and products_id

    that was it!!...thank you very much!

  4. #4
    Join Date
    Jan 2012
    Posts
    59
    Plugin Contributions
    0

    Default allowing adding to cart with prodcuts_model

    Hi,

    I am trying to be abel to add items to my cart by either using product_id or products_model. I am think I could write some code so that when it receives a model number i could run a query that would grab the corresponding id number.

    where would i need to put this code? also any help with the coce would be appreciated.

    for example:
    this is what the it does now

    <form name="multiple_products_cart_quantity" action="http://websitehere/index.php? main_page=index&amp;cPath=4_55_59&amp;sort=20a&amp;action=multiple_products_add_ product" method="post" enctype="multipart/form-data">
    <input type="text" name="products_id[11307]" value="1" size="4" />
    </form>

    I want it to look like this..

    <form name="multiple_products_cart_quantity" action="http://websitehere/index.php?main_page=index&amp;cPath=4_55_59&amp;sort=20a&amp;action=multiple_pro ducts_add_product" method="post" enctype="multipart/form-data">
    <input type="text" name="products_model[LP5899]" value="1" size="4" />
    </form>

    thanks,
    Will
    Last edited by warroyo90; 20 Jan 2012 at 04:38 AM. Reason: added code

  5. #5
    Join Date
    Jan 2012
    Posts
    59
    Plugin Contributions
    0

    Default cant find file for editing for input quantity on product listing

    i want to know where i can edit the code that does:

    HTML Code:
    <input type="text" name="products_id[6114]" value="0" size="4">
    it is what creates the input for the quantity in the product listing page

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

    Default Re: cant find file for editing for input quantity on product listing

    /includes/modules/your_custom_template_name/product_listing.php
    .

    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. Replies: 2
    Last Post: 17 Jan 2011, 12:04 AM
  2. Use products_model instead of products_id for url
    By stevenlee in forum General Questions
    Replies: 5
    Last Post: 15 Mar 2009, 07:20 PM
  3. accessing existing product database with zencart
    By grossd in forum Templates, Stylesheets, Page Layout
    Replies: 4
    Last Post: 9 Feb 2009, 03:26 AM
  4. products_model or products_id setting?
    By w2e in forum General Questions
    Replies: 3
    Last Post: 1 Apr 2008, 05:12 AM
  5. Replies: 6
    Last Post: 23 May 2007, 08:47 PM

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