Forums / Templates, Stylesheets, Page Layout / Show option value's on productlisting just show them, nothing else?

Show option value's on productlisting just show them, nothing else?

Views: 1,602

Results 1 to 10 of 10
16 Mar 2014, 10:57 AM
#1
karinvd avatar

karinvd

New Zenner

Join Date:
Nov 2012
Location:
Utrecht, Nederland
Posts:
43
Plugin Contributions:
0

Show option value's on productlisting just show them, nothing else?

Is there a way to show options value ( like size) on the productlisting? The only thing i find is showing attributes and put them in de shoppingcart directly from the productlisting. Thats not wat i need, i only want the size to show on de productlisting page. To make clear what i want here is a picture:
Attachment 13896
The red sizes are put there with gimp.
Can someone put me in the right direction?

16 Mar 2014, 1:31 PM
#2
stevesh avatar

stevesh

Black Belt

Join Date:
Feb 2005
Location:
Lansing, Michigan USA
Posts:
19,793
Plugin Contributions:
2

Re: Show option value's on productlisting just show them, nothing else?

It's not clear if you want the customer to be able to choose a size from the product listing or if you just want to list sizes available.

16 Mar 2014, 1:47 PM
#3
karinvd avatar

karinvd

New Zenner

Join Date:
Nov 2012
Location:
Utrecht, Nederland
Posts:
43
Plugin Contributions:
0

Re: Show option value's on productlisting just show them, nothing else?

I want the costumer to see in which sizes the underwear is available, no need to choose. They can choose from de product info page. :-)
I have zencart 151 and i use stock-with-attibutes.
Thank you for asking :-)
link: https://www.domak.nl/boxershorts

16 Mar 2014, 4:30 PM
#4
twitchtoo avatar

twitchtoo

Totally Zenned

Join Date:
Apr 2007
Location:
Ontario, Canada
Posts:
1,733
Plugin Contributions:
14

Re: Show option value's on productlisting just show them, nothing else?

You'll need to simply output the attribute names in the loop - to the screen in this case the product listing. The product info page takes the array data and publishes it in your chosen dropdown/radio button etc.

Twitch.
https://www.twitchtoo.com Do you work for free? Please donate.
June 7.2026 - NOW AVAILABLE - Twitch Base8 - Obsidian

16 Mar 2014, 6:31 PM
#5
karinvd avatar

karinvd

New Zenner

Join Date:
Nov 2012
Location:
Utrecht, Nederland
Posts:
43
Plugin Contributions:
0

Re: Show option value's on productlisting just show them, nothing else?

Don't i need som information from attributes.php? I use grid for showing my attributes on the product_info page. If i look up what seems to generated the size on the product page its this line in attributes.php:

$grid_records['V']['options'][$grv]['name']

But if i put that line in product_listing.php nothing happens and i think that's because the info page requires tpl_modules_attributes.php
So i think i have to do some copying. I was kind of hoping there was an easy way to place my size's on the listing page.
I'l struggle further hoping someone will point me in the right direction :-)

16 Mar 2014, 6:59 PM
#6
twitchtoo avatar

twitchtoo

Totally Zenned

Join Date:
Apr 2007
Location:
Ontario, Canada
Posts:
1,733
Plugin Contributions:
14

Re: Show option value's on productlisting just show them, nothing else?

It's a loop, it cycles through the available attributes and displays them if it finds them in the array. You have one piece of the loop in that code, try using the entire loop on the product listing page...

Twitch.
https://www.twitchtoo.com Do you work for free? Please donate.
June 7.2026 - NOW AVAILABLE - Twitch Base8 - Obsidian

8 Apr 2014, 12:01 PM
#7
karinvd avatar

karinvd

New Zenner

Join Date:
Nov 2012
Location:
Utrecht, Nederland
Posts:
43
Plugin Contributions:
0

Re: Show option value's on productlisting just show them, nothing else?

I'm still struggeling with this. The problem is i dont know wat to put in the product_listing. i tried this:

 $lc_text =$listing->fields['products_quantity'] . '<br/><a href="' . zen_href_link(FILENAME_DEFAULT, 'manufacturers_id=' . $listing->fields['manufacturers_id']) . '">' . $listing->fields['manufacturers_name'] . '</a><br/>';

This works what i get is the quantity of the products in total.

What i want is just the name of the attributes so i looked around in the codes and found in /includes/classes/order.php this line // 'products_options_values' => $attributes_values->fields['products_options_values_name'], so i tried:

 $lc_align = '';
        $lc_text = $attributes_values->fields['products_options_values_name'] . '<a href="' . zen_href_link(FILENAME_DEFAULT, 'manufacturers_id=' . $listing->fields['manufacturers_id']) . '">' . $listing->fields['manufacturers_name'] . '</a><br/>';
  break;

Can someone point me in the right direction? I unterstand it is a loop, but in dont understand to make this loop. In a ideal world i only want to display the attribute when its product_options_id is 1 or 4 and the quantity is > 0
I'm learning but now im stuck. Help?

8 Apr 2014, 11:03 PM
#8
gjh42 avatar

gjh42

Black Belt

Join Date:
Jul 2005
Location:
Upstate NY
Posts:
21,876
Plugin Contributions:
8

Re: Show option value's on productlisting just show them, nothing else?

Any of those arrays you are posting will only exist on a page where they have been created or populated by other code (not the product listing page). What you want is simpler than the other situations, so the best bet would probably be to add a SQL query to the file (probably main_template_vars.php) that builds the data for use in the listing. I would have to examine the files to see exactly what form that would take; it might be possible to extend an existing query, or maybe make a new one which then adds its data to the main array.

9 Apr 2014, 7:45 PM
#9
karinvd avatar

karinvd

New Zenner

Join Date:
Nov 2012
Location:
Utrecht, Nederland
Posts:
43
Plugin Contributions:
0

Re: Show option value's on productlisting just show them, nothing else?

Ok, i'm using Attributes grid on my product_info page, and i figured a query i can use must be in there. But indeed its is much more complex then i need, so i get confused. I forgot to check main_template_vars.php thats the next thing i'm going to do. Thank you :-) i really want to figure this out. I'm going to try to write a SQL query an post it here. which main_template_vars.php is the best one to put the new sql in? product_info or document_product_info?

9 Apr 2014, 8:29 PM
#10
gjh42 avatar

gjh42

Black Belt

Join Date:
Jul 2005
Location:
Upstate NY
Posts:
21,876
Plugin Contributions:
8

Re: Show option value's on productlisting just show them, nothing else?

Whichever one corresponds to the product type you are using. Ordinary products will use product_info.php.