Forums / All Other Contributions/Addons / accessing product pages with products_model and products_id

accessing product pages with products_model and products_id

Views: 951

Results 1 to 6 of 6
18 Jan 2012, 10:56 PM
#1
warroyo90 avatar

warroyo90

New Zenner

Join Date:
Jan 2012
Posts:
59
Plugin Contributions:
0

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?

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

18 Jan 2012, 11:06 PM
#2
niccol avatar

niccol

Totally Zenned

Join Date:
Apr 2009
Posts:
2,138
Plugin Contributions:
1

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.

Nick
iszent.com

19 Jan 2012, 12:47 AM
#3
warroyo90 avatar

warroyo90

New Zenner

Join Date:
Jan 2012
Posts:
59
Plugin Contributions:
0

Re: accessing product pages with products_model and products_id

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

20 Jan 2012, 3:31 AM
#4
warroyo90 avatar

warroyo90

New Zenner

Join Date:
Jan 2012
Posts:
59
Plugin Contributions:
0

Re: accessing product pages with products_model and products_id

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&cPath=4_55_59&sort=20a&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&cPath=4_55_59&sort=20a&action=multiple_products_add_product" method="post" enctype="multipart/form-data"> <input type="text" name="products_model[LP5899]" value="1" size="4" /> </form>

thanks,
Will

20 Jan 2012, 5:19 AM
#5
warroyo90 avatar

warroyo90

New Zenner

Join Date:
Jan 2012
Posts:
59
Plugin Contributions:
0

Re: accessing product pages with products_model and products_id

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

<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

20 Jan 2012, 6:13 AM
#6
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,515
Plugin Contributions:
176

Re: accessing product pages with products_model and products_id

/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.