Zen Cart Logo
Forums / Templates, Stylesheets, Page Layout / Products on single line with QTY and ADD button?

Products on single line with QTY and ADD button?

Locked

Views: 3,314

Results 1 to 16 of 16
This thread is locked. New replies are disabled.
20 Jan 2007, 1:37 PM
#1
peekay avatar

peekay

Zen Follower

Join Date:
Jun 2006
Location:
U.K.
Posts:
103
Plugin Contributions:
0

Products on single line with QTY and ADD button?

I have been asked to quote for an ecommerce site to sell industrial fastners. I can set up Zen Cart categories to enable customers to navigate to a product, but the products often have 10+ varients (e.g. screw-thread diameter) each with a different stock code.

Can I hack Zen Cart to display products within a category in a simple 'table' style, with each product on a new line with a 'QTY' and 'Add to cart' button?

E.g. in a category called 'Zinc-plated Fastners' could I display:

#12345     10mm     1.50     [   ]   [Add to cart]
#12346     15mm     2.00     [   ]   [Add to cart]
#12347     20mm     2.25     [   ]   [Add to cart]
#12348     25mm     3.00     [   ]   [Add to cart]

I looked at using attributes, but the differing stock code makes it a problem.

20 Jan 2007, 2:35 PM
#2
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

Re: Products on single line with QTY and ADD button?

You could make a Category for the group of products then put each size as its own product and on the listing use the multiple add to cart feature so that the customer just enters the quantity wanted and then hits either enter or clicks the add selected products to cart button ... this also allows for managing stock better as each size is its own product ...

Or you might look at the cross sell or Xsell add-on and see if this helps you relate like products together in a manner that works for you ...

Or, you can use attributes for the sizes and make 1 product with the price difference or use the Products Priced by attribute feature ... however you can still only add one at a time and either turn off the Display Shopping Cart when products are added to the cart so the customer can change the size and add the next size they want ... or leave the display cart and they can click the link to that product to go back and add the next size that they need ...

Otherwise, you would need something customized ...

20 Jan 2007, 3:38 PM
#3
peekay avatar

peekay

Zen Follower

Join Date:
Jun 2006
Location:
U.K.
Posts:
103
Plugin Contributions:
0

Re: Products on single line with QTY and ADD button?

Many thx Ajeh. I just realised the product listing screen with the 'Add selected to cart' button already provides that layout. As you suggest, I can make each varient a separate product. With a little customisation I think I can achieve what they want.

Is there a FAQ that explains which template I would need to tinker with to fine tune this particular screen?

20 Jan 2007, 4:13 PM
#4
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

Re: Products on single line with QTY and ADD button?

Usually, the place to start is with the name of the page you see in the URL ...

This would show you index.php ...

Looking in there, you would see that when on a Category with products ... that the products_listing is called ...

There are several components to the code ...

Before changing the code itself ... often you just need to configure the settings ...

In this case, the Configuration ... Product Listing ... would allow you to change the display for the Category of Products Listing as well as what you see on the search ...

0=OFF and any other value is the Sort Order of the columns ...

20 Jan 2007, 5:10 PM
#5
peekay avatar

peekay

Zen Follower

Join Date:
Jun 2006
Location:
U.K.
Posts:
103
Plugin Contributions:
0

Re: Products on single line with QTY and ADD button?

I have adjusted the configuration/product list options and now have the right elements displayed, but I have hit a snag. The listing shows the product price, but places it above the QTY field., e.g.

                         Price
Model No.     Item       QTY box

I need the price followed by the QTY box on the same line, e.g.

Model No.     Item       Price        QTY box

I checked the page source and found 2 line breaks after the price:

<td class="productListing-data" align="right">£0.26<br /><br />

So I set up a template and edited line 108 of 'product_listing.php' and removed the break tag from the end of that statement.

$lc_price = zen_get_products_display_price($listing->fields['products_id']) . '<br />';

Unfortunately, I still get a single break tag:

<td class="productListing-data" align="right">£0.26<br />

Can you hint at where that is being generated so I can get rid of it? :lookaroun Of course, I am assuming that is why the price is where it is?

20 Jan 2007, 5:12 PM
#6
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

Re: Products on single line with QTY and ADD button?

How about an URL where we can peek at your site ... :smile:

20 Jan 2007, 5:17 PM
#7
peekay avatar

peekay

Zen Follower

Join Date:
Jun 2006
Location:
U.K.
Posts:
103
Plugin Contributions:
0

Re: Products on single line with QTY and ADD button?

Sorry Ajeh, I'm just messing with the site on my PC at the moment. I'll grab a small screenshot of the problem.

20 Jan 2007, 5:27 PM
#8
peekay avatar

peekay

Zen Follower

Join Date:
Jun 2006
Location:
U.K.
Posts:
103
Plugin Contributions:
0

Re: Products on single line with QTY and ADD button?

Screenshot attached. I am using the default template. (apologies for duplicate post - edit timed out on me)

20 Jan 2007, 5:45 PM
#9
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

Re: Products on single line with QTY and ADD button?

You would need to customize:
/includes/modules/products_listing.php

And change the case statement around 114 for:
case 'PRODUCT_LIST_PRICE':

Copy the file to your templates and overrides directory ...

Note there is a setting in the Configuration ... Products Listing ... for the width of that field if it wraps after you remove the 2 <br /> in there ...

20 Jan 2007, 6:01 PM
#10
peekay avatar

peekay

Zen Follower

Join Date:
Jun 2006
Location:
U.K.
Posts:
103
Plugin Contributions:
0

Re: Products on single line with QTY and ADD button?

Thx but I already did that. I only found one BR tag in that case. I deleted it, but still get one in the listing.

20 Jan 2007, 6:06 PM
#11
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

Re: Products on single line with QTY and ADD button?

There are two ...
line 115:

        $lc_price = zen_get_products_display_price($listing->fields['products_id']) . '<br />';

line 155:

        $lc_text .= '<br />' . zen_get_buy_now_button($listing->fields['products_id'], $the_button, $products_link) . '<br />' . zen_get_products_quantity_min_units_display($listing->fields['products_id']);
20 Jan 2007, 6:31 PM
#12
peekay avatar

peekay

Zen Follower

Join Date:
Jun 2006
Location:
U.K.
Posts:
103
Plugin Contributions:
0

Re: Products on single line with QTY and ADD button?

Yep! Just found the second one! :D

Replaced it with a few non-breaking spaces to pad the price away from the QTY box. May try putting it in it's own TD later, but need a few beers first!.

Many thanks for your help.

5 Dec 2007, 10:20 AM
#14
peekay avatar

peekay

Zen Follower

Join Date:
Jun 2006
Location:
U.K.
Posts:
103
Plugin Contributions:
0

Re: Products on single line with QTY and ADD button?

Thx for the link :smile:

25 Feb 2009, 2:03 AM
#15
1408329330 avatar

1408329330

New Zenner

Join Date:
Feb 2009
Posts:
5
Plugin Contributions:
0

Re: Products on single line with QTY and ADD button?

Hello,

Hopefully someone still checks this thread out - I am trying to do basicly the same thing - my problem is - category name are limited to 32char - can this be changed?

Thanks

25 Feb 2009, 4:23 AM
#16
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

Re: Products on single line with QTY and ADD button?

I am not sure how the size of category name is related here ... but then it is late and I am tired ... :unsure:

You would need to modify your database table categories_description for the categories_name it is set to 32 by default ...

The can be done in phpMyAdmin ... but first, be sure to backup your database before making any changes ...