Product Attribute Box is empty

Have a question or a suggestion about a 3rd party addon module or plugin?
Let us know here.
Post Reply
amhoffmaster
Forum Members
Forum Members
Posts: 121
Joined: Sat Jan 03, 2009 5:05 pm

Product Attribute Box is empty

Post 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?
amhoffmaster
Forum Members
Forum Members
Posts: 121
Joined: Sat Jan 03, 2009 5:05 pm

Re: Product Attribute Box is empty

Post 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.
maranc
Forum Members
Forum Members
Posts: 249
Joined: Tue May 04, 2010 5:04 pm

Re: Product Attribute Box is empty

Post 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.
amhoffmaster
Forum Members
Forum Members
Posts: 121
Joined: Sat Jan 03, 2009 5:05 pm

Re: Product Attribute Box is empty

Post 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.
maranc
Forum Members
Forum Members
Posts: 249
Joined: Tue May 04, 2010 5:04 pm

Re: Product Attribute Box is empty

Post by maranc »

Please copy and paste what you have if you add:

{$entry->attributes|@print_r}
{$entry->attribs_full|@print_r}

Marek A.
amhoffmaster
Forum Members
Forum Members
Posts: 121
Joined: Sat Jan 03, 2009 5:05 pm

Re: Product Attribute Box is empty

Post 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
maranc
Forum Members
Forum Members
Posts: 249
Joined: Tue May 04, 2010 5:04 pm

Re: Product Attribute Box is empty

Post 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
amhoffmaster
Forum Members
Forum Members
Posts: 121
Joined: Sat Jan 03, 2009 5:05 pm

Re: Product Attribute Box is empty

Post by amhoffmaster »

Ok, thanks Marek.
amhoffmaster
Forum Members
Forum Members
Posts: 121
Joined: Sat Jan 03, 2009 5:05 pm

Re: Product Attribute Box is empty

Post by amhoffmaster »

no one else is having this problem with the product attributes drop down box being blank????
swanriver
Forum Members
Forum Members
Posts: 44
Joined: Sun Apr 29, 2007 5:24 pm
Location: Cape Cod, Massachusetts

Re: Product Attribute Box is empty

Post by swanriver »

@amhoffmaster

Did you ever solve this problem? I'm stumped on this also.
amhoffmaster
Forum Members
Forum Members
Posts: 121
Joined: Sat Jan 03, 2009 5:05 pm

Re: Product Attribute Box is empty

Post 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.
User avatar
Dr.CSS
Moderator
Moderator
Posts: 12711
Joined: Thu Mar 09, 2006 5:32 am
Location: Arizona

Re: Product Attribute Box is empty

Post by Dr.CSS »

Make sure Products is set in CGEcommerce base module...
swanriver
Forum Members
Forum Members
Posts: 44
Joined: Sun Apr 29, 2007 5:24 pm
Location: Cape Cod, Massachusetts

Re: Product Attribute Box is empty

Post 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. :)
User avatar
Dieteronline
Forum Members
Forum Members
Posts: 32
Joined: Sat Dec 04, 2010 11:20 pm

Re: Product Attribute Box is empty

Post 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
swanriver
Forum Members
Forum Members
Posts: 44
Joined: Sun Apr 29, 2007 5:24 pm
Location: Cape Cod, Massachusetts

Re: Product Attribute Box is empty

Post by swanriver »

Thanks Dieter. Will certainly give this a try later. BTW, love your avatar!
Post Reply

Return to “Modules/Add-Ons”