Re: Product Attribute Grid
<?php
switch($_GET['action']) {
case 'add_product':
if (is_array($_POST['products_id'])) {
foreach($_POST['products_id'] as $prid => $qty) {
$products_id = zen_get_prid($prid);
if (is_array($_POST['id'])) {
foreach($_POST['id'] as $option => $option_value) {
$_POST['attribs'][$prid][$option] = $option_value;
}
}
foreach($_POST['attribs'][$prid] as $option_id => $value_id) {
if (substr($option_id, 0, strlen(TEXT_PREFIX)) == TEXT_PREFIX) {
$option_id = substr($option_id, strlen(TEXT_PREFIX));
}
$check_attrib = $db->Execute( "select pov.products_options_values_name from " . TABLE_PRODUCTS_ATTRIBUTES . " pa, " . TABLE_PRODUCTS_OPTIONS_VALUES . " pov " .
"where pa.options_values_id = pov.products_options_values_id " .
"and pa.options_id = '".(int)$option_id . "' " .
"and pa.products_id = '".(int)$products_id ."' " .
"and pov.language_id = '".(int)$_SESSION['languages_id']."'");
if ($check_attrib->RecordCount() <= 1 && $check_attrib->fields['products_options_values_name'] == '') {
unset($_POST['attribs'][$prid][$option_id]);
}
}
if ((int)$qty > 0) {
reset($_POST['attribs'][$prid]);
$_SESSION['cart']->add_cart($products_id, $qty, $_POST['attribs'][$prid]);
}
}
}
$messageStack->reset();
unset($_SESSION['cart_errors']);
$_SESSION['cart']->get_products(false); //Update all prices now we have added everything
break;
}
?>
that's the code
1 Attachment(s)
Re: Product Attribute Grid
Hello,
Thank you for a great module! It is very close to what I need... but just want a slight added functionality - maybe it is built into this mod and I don't know about it yet? :)
Here's a screenshot what I'm looking for. I want a combo dropdown and quantity box - so that I dont have quantity for every Option Value, but rather one for each Option Name.
Is it doable?
Re: Product Attribute Grid
It looks like you want to have 2 different products on the same page. One for the top, and one for the bottom. This isn't possible with this mondule, and you would also struggle to achieve this with custom Zen code, as the number of attributes has to match the number of products. For example, if you have red/green/blue and S/M/L, you can have 5 S red, or 3 M green, but you can't have 5 red and 3 green, as the attributes are tied together.
What you are look at doing is more along the lines of a different end category layout, where the category is the outfit, with one image. The products in this category are then the products you can see in the photo, and then showing the attribute options within this layout. This is possible, but outside the scope of this particular module.
Absolute
Re: Product Attribute Grid
Well, I'm utilizing the Top and Bottom as attributes. There's only going to be sizes, not colors here.
Attribute Top:
XS - S - M - L
Attribute Bottom:
XS - S - M - L
I already have what I need all setup in attributes, and your module almost gets what I need - but to have it more aesthetically pleasing I do not want it all in quantity boxes, just a simple dropdown and one quantity box per attribute.
I'm sure it's possible with this module, I was just wondering if you had a shortcut way to do it, or if I need to custom code.
Re: Product Attribute Grid
Oh... I'm seeing where the issue is here. This module actually cross-grids the two attributes together, instead of keeping them separate.
Well, back to the drawing board - but if you have any suggestions, please let me know :)
Re: Product Attribute Grid
The problem with what you are trying to achieve here is that actually you have 2 products - TOP and BOTTOM, and these then have a single attribute of SIZE for each product. For example, if a top is $5.00 and a bottom is $10.00, there is nothing to stop me from ordering 10 tops and 1 bottom. As you are trying to combine these products into one attriubte, the system would then add 10 "products" to the cart, and only assign one bottom price. This is going to land you in all kinds of trouble in the future if you ever try to install other modules, or upgrade your site.
Instead, I would recommend you thing about using the "outfit category" which I mentioned above. So, the customer would navigate to Clothing >> Womens >> Gym Wear >> Outfit, where they would then see the top and bottom, and even trainers and accessories listed with one image to the left. If they wanted to examine the products individually, they can then go on to the product page, but here they would see the whole outfit, and be able to add the products and sizes they needed.
This is still a fair amount of work, and not a quick fix, but it would allow you much greater flexibility within your store in the future, such as being able to use cross-sell items, similar items or other "outfits".
Absolute
Re: Product Attribute Grid
The problem with what you are trying to achieve here is that actually you have 2 products - TOP and BOTTOM, and these then have a single attribute of SIZE for each product. For example, if a top is $5.00 and a bottom is $10.00, there is nothing to stop me from ordering 10 tops and 1 bottom. As you are trying to combine these products into one attriubte, the system would then add 10 "products" to the cart, and only assign one bottom price. This is going to land you in all kinds of trouble in the future if you ever try to install other modules, or upgrade your site.
Instead, I would recommend you thing about using the "outfit category" which I mentioned above. So, the customer would navigate to Clothing >> Womens >> Gym Wear >> Outfit, where they would then see the top and bottom, and even trainers and accessories listed with one image to the left. If they wanted to examine the products individually, they can then go on to the product page, but here they would see the whole outfit, and be able to add the products and sizes they needed.
This is still a fair amount of work, and not a quick fix, but it would allow you much greater flexibility within your store in the future, such as being able to use cross-sell items, similar items or other "outfits".
Absolute
Re: Product Attribute Grid
Unfortunately though, the Cross-sell module will not sell on a category level, and also Google Shopping shows individual products.
My client would want the top and bottom to show as one piece in advertisements, and bring the client to the one product page, while still allowing them to select both the top and bottom at their whim.
Re: Product Attribute Grid
i have downloaded attribute grid 1.1.1
i have 4 files but i believe i only copy 3 folders inot my root files.
is this true, if so can you tell me what the "language folder is for?
i have noticed that there are no instructions on how to use the feature. does anyone know a good site where their is help with this.
Also does anyone have any working links to a store with an attributes grid, as i have no idea what the end result would look like.
i have two examples of what i am hoping for it to look like, please take a look and tell me if it is possible to achieve this with the attributes grid or do i need some thing else:
http://www.diamondbladedealer.com/co...bb540f85326646
http://www.homelinen.co.uk/homelinen...unt_150210.htm
these two types of different, listed product descriptions, with color (dropdown) and QTY is what i am looking for. is this what the attribute grid addon is for or is there another way?
thank you once again you lot are great
Re: Product Attribute Grid
Quote:
Originally Posted by
theAymen
Also does anyone have any working links to a store with an attributes grid, as i have no idea what the end result would look like.
If you are willing to do a little research through this support thread, there are examples posted by other members..