Page 1 of 1
Product Attribute Box is empty
Posted: Thu Oct 27, 2011 12:06 am
by amhoffmaster
I'm working on a demo site to show customers various CMSMS features. I'm using the CG e-commerce suite. I've added products, attributes, images, etc. Everything is working correctly EXCEPT the product attributes box in the add to cart function. It appears blank, but if you click on the "space" in the box, it adds the last option added to the product. Here's the link to the page
http://www.pittsburgh-websitedesign.com ... eturnid=87
Using the latest versions of the cg e-commerce suite and CMSMS.
Here's my summary template.
Code: Select all
<div class="products-detail">
<h1>{$entry->product_name}</h1>
<img align="center" src="{$entry->file_location}/{$entry->fields.prodimage->value}" alt="{$entry->product_name}"/>
<div><p>{$entry->details}</p></div>
{* print out attributes *}
{if isset($entry->attributes)}
{foreach from=$entry->attributes key='name' item='attribset'}
<p><strong>{$name}:</strong>
{foreach from=$attribset key='label' item='adjustment'}
{$label} ({$currency_symbol}{$adjustment}),
{/foreach}
</p>
<p><b>Price: {$currency_symbol}{$entry->price}</b></p>
{/foreach}
{/if}
{* include the cart *}
{cgecomm_form_addtocart product=$entry->id}
</div>
Any ideas? Is the code in the add to cart function at the bottom wrong?
Re: Product Attribute Box is empty
Posted: Thu Oct 27, 2011 4:55 pm
by amhoffmaster
I don't see a public option for product attribute sets. There's a public option for field definitions. I see someone else on this forum is having the same problem with this field.
Re: Product Attribute Box is empty
Posted: Thu Oct 27, 2011 8:04 pm
by maranc
Try this code:
Code: Select all
{if isset($entry->attribs_full)}
<h4>Attributes</h4>
{foreach from=$entry->attributes key='name' item='attribset'}
<h6>{$name}</h6>
<div class="product_detail_field"><p>
{foreach from=$attribset key='label' item='attribute'}
{$label} ({$attribute.sku}): {$attribute.attrib_adjustment}<br/>
{/foreach}
</p></div>
{/foreach}
{/if}
If this will not work add to your template:
Code: Select all
{$entry->attributes|@print_r}
{$entry->attribs_full|@print_r}
to check what is in array.
Attributes haven't option like public. Here you sure.
Marek A.
Re: Product Attribute Box is empty
Posted: Thu Oct 27, 2011 8:38 pm
by amhoffmaster
The first suggestion didn't work. It didn't display the the addition to the price (for example, +$2 for 11x17) for the option selected. So, I took it back to my original template.
Then I added the code from your second suggestion. It prints the options on the screen, but there's still nothing in the drop down box.
I'm not a programmer so this line of code doesn't mean anything to me other than I can see that the attributes I added are there.
Re: Product Attribute Box is empty
Posted: Thu Oct 27, 2011 8:55 pm
by maranc
Please copy and paste what you have if you add:
{$entry->attributes|@print_r}
{$entry->attribs_full|@print_r}
Marek A.
Re: Product Attribute Box is empty
Posted: Thu Oct 27, 2011 9:05 pm
by amhoffmaster
Here's what shows on the screen where I placed that code.
Code: Select all
Array ( [Size] => Array ( [11 x 17"] => +2.00 [22 x 35"] => +5.00 ) ) 1 Array ( [Size] => Array ( [11 x 17"] => Array ( [attrib_id] => 10 [attrib_set_id] => 4 [attrib_text] => 11 x 17" [attrib_adjustment] => +2.00 [sku] => ) [22 x 35"] => Array ( [attrib_id] => 11 [attrib_set_id] => 4 [attrib_text] => 22 x 35" [attrib_adjustment] => +5.00 [sku] => ) ) ) 1
Re: Product Attribute Box is empty
Posted: Thu Oct 27, 2011 9:11 pm
by maranc
Sorry, I'm so stupid

. Add to cart is not in products module. Solution must be in Cart action.default.php andd CgEcommerceBase.
I dont have today time, but tomorrow I will look on code.
Marek A
Re: Product Attribute Box is empty
Posted: Thu Oct 27, 2011 9:18 pm
by amhoffmaster
Ok, thanks Marek.
Re: Product Attribute Box is empty
Posted: Mon Oct 31, 2011 4:00 pm
by amhoffmaster
no one else is having this problem with the product attributes drop down box being blank????
Re: Product Attribute Box is empty
Posted: Wed Feb 01, 2012 8:22 pm
by swanriver
@amhoffmaster
Did you ever solve this problem? I'm stumped on this also.
Re: Product Attribute Box is empty
Posted: Wed Feb 01, 2012 9:13 pm
by amhoffmaster
No, there was never any further help on this topic. It still doesn't work. I'm surprised no one else has had this problem. I did a very basic test of the module on a demo site. Makes me not want to use this module as a shopping cart solution if there's no answer from the developer.
Re: Product Attribute Box is empty
Posted: Thu Feb 02, 2012 3:43 am
by Dr.CSS
Make sure Products is set in CGEcommerce base module...
Re: Product Attribute Box is empty
Posted: Thu Feb 02, 2012 2:23 pm
by swanriver
@ Dr. CSS: Yes, I did that
I have been working on this and believe I may have found a solution. In my default detail template:
Code: Select all
{* print out attributes *}
{if isset($entry->attribs_full)}
{foreach from=$entry->attributes key='name' item='attribset'}
<select id='' name=''>
{foreach from=$attribset key='label' item='attribute'}
<option value=''name='{$attribute.attrib_text}' label='{$label}'>{$label} {$attribute.attrib_adjustment|string_format:"%.2f"}</option>
{/foreach}
</select>
{/foreach}
{/if}
This is not finalized, note: <select id="" and name="".
Now, the only problem I have left is that "$attribute.attrib_adjustment", which is my price, is not formatting properly. The "string_format" modifier is off, since I need to show "1,234,567.89", and it is only showing single digits.
Would appreciate a bit of feedback if this helps or does not help. I think I'm on the right track, but a little confirmation would be nice.

Re: Product Attribute Box is empty
Posted: Mon Mar 12, 2012 12:44 pm
by Dieteronline
Hi there,
Don't know if your still working on this problem but i had the same problem en found this topic:
http://forum.cmsmadesimple.org/viewtopi ... 9&p=274812
Its does nos describe your problem but somwhere down JimoDavies said:
"At the bottom of the page is "Product Attribute Display Template" which sounds like it's configuring how the attributes are retrieved and displayed. Mine currently displays:"
Code: Select all
{$attrib_text} {*if !empty($attrib_adjust)*} {*+*}{*$currency_symbol*}{*$attrib_adjust|number_format:2*} {*/if*}
Go to CGEcommerceBase, and go to "Supplier Settings" and i placed that code at the bottom of that page and it works now.
Hope it helps!
Regards,
Dieter
Re: Product Attribute Box is empty
Posted: Mon Mar 12, 2012 7:56 pm
by swanriver
Thanks Dieter. Will certainly give this a try later. BTW, love your avatar!