Page 1 of 1

Cart module get php error

Posted: Thu May 06, 2010 1:06 pm
by sykic
I have
CMSMS 1.7

Products
2.7.4

Orders
1.8.4

As installed with no mods I get above the add to cart button
the following error

Code: Select all

Warning: Parameter foo is not known by module Cart dropped in /home/artcraf2/public_html/sykic.co.uk/lib/misc.functions.php on line 1418
if I edit the detail template

changing the line near the bottom from
{cgecomm_form_addtocart product=$entry->id foo='bar'}

to
{cgecomm_form_addtocart product=$entry->id }


it all works OK or seems to

can anyone explain this
I am new to CMSMS and don't want to cause an unforseen side effect ?


sykic

Re: Cart module get php error

Posted: Tue May 11, 2010 10:58 am
by njprrogers
I'll second this question... Is there an issue with a new release?
CMSMS 1.7
Orders 1.8.6
Cart 1.6.2
Products 2.7.6
CGEcommerceBase 1.0.1

Re: Cart module get php error

Posted: Tue May 11, 2010 11:02 am
by njprrogers
{* uncomment the following line if the Promotions module is installed *}
{* promo_get_prod_discount product_id=$entry->id assign='foo' *}

This field is only getting set if the promotions module is installed. It can be removed if you are not using Promotions... template doesn't work out of the box now.

Re: Cart module get php error

Posted: Thu May 20, 2010 5:02 pm
by scotch33
Ok I have a similar issue - I have the following installed...

1.7
Products 2.8
Promootions 1.0.6

I have uncommented the line about promtions in the template so it now reads

Code: Select all

{* uncomment the following line if the Promotions module is installed *}
{promo_get_prod_discount product_id=$entry->id assign='foo'}
Yet I am still getting the "Warning: Parameter foo is not known by module Cart dropped in /home/ileorg/public_html/lib/misc.functions.php on line 1418" error appearing in my details template.

Re: Cart module get php error

Posted: Thu May 20, 2010 5:06 pm
by calguy1000
That's not the line that's generating the error.
Just remove the 'foo' stuff.
it was a MINOR (not worth a new release) thing that I forgot to change in the default templates.

Re: Cart module get php error

Posted: Wed Jun 30, 2010 9:26 am
by scotch33
Hi,

Ok - I actually ended up not using the details template on the last shop, but now I am usign one and cannot avoid it, so I need to clarify a solution for this.  The problem as statyed above is that...

Warning: Parameter foo is not known by module Cart dropped in /home/mpssocie/public_html/lib/misc.functions.php on line 1418

.. appears in the page.

I DO have promotions 1.0.7 installed, with products 2.8.2 in cmsms 1.7.1.

I have attempted to comment the line, uncomment the line and remove the full section (as shown below).

Code: Select all

{* uncomment the following line if the Promotions module is installed *}
{* promo_get_prod_discount product_id=$entry->id assign='foo' *}
{if isset($foo.promo_id)}
<span style="color: red;">Discount:  {$currency_symbol}{$foo.discount|number_format:2} ({$foo.percentage|number_format:2}%)</span><br/>
{if $entry->price ne ''}
Price {$currency_symbol}: {$entry->price * $foo.decimal|number_format:2}<br />
{/if}
{elseif $entry->price ne ''}
Price {$currency_symbol}: {$entry->price}<br />
{/if}
In all cases the error line is still there. 

here is the full off the shelf template - if anyone can point out the EXACT bit that needs changing / removing so I can get rid of the error message, I'd really appreciate it.

Code: Select all

{* this is a sample product detail template *}
{assign var='products' value=$mod}
<div class="ProductDirectoryItem">

{if is_array($entry->breadcrumb)}
Breadcrumb:  {' >> '|implode:$entry->breadcrumb}<br/>
{/if}

Name: <a name="product_name" style="text-decoration: none;">{$entry->product_name}</a><br />
File Location: {$entry->file_location}<br/>


{if $entry->weight ne ''}
Weight {$weight_units}: {$entry->weight}<br />
{/if}

Breadcrumb: {$entry->breadcrumb}

{if $entry->details ne ''}
Details:<br />
{$entry->details}<br />
{/if}

{* uncomment the following line if the Promotions module is installed *}
{* promo_get_prod_discount product_id=$entry->id assign='foo' *}
{if isset($foo.promo_id)}
<span style="color: red;">Discount:  {$currency_symbol}{$foo.discount|number_format:2} ({$foo.percentage|number_format:2}%)</span><br/>
{if $entry->price ne ''}
Price {$currency_symbol}: {$entry->price * $foo.decimal|number_format:2}<br />
{/if}
{elseif $entry->price ne ''}
Price {$currency_symbol}: {$entry->price}<br />
{/if}

{* accessing all of the fields in a list *}
{if count($entry->fields)}
  <h4>Custom Fields</h4>
  {foreach from=$entry->fields key='name' item='field'}
     <div class="product_detail_field"><p>
       {$mod->Lang('name')}: {$name}<br/>
       {$mod->lang('type')}: {$field->type}<br/>
       {$mod->lang('value')}: {$field->value}<br/>
       {if $field->type == 'image' && isset($field->thumbnail)}
         <img src="{$entry->file_location}/{$field->thumbnail}" alt="{$field->value}"/>
       {/if}
     </p></div>
  {/foreach}
{/if}

{* print out attributes *}
{if isset($entry->attributes)}
  <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='adjustment'}
         {$label}: {$adjustment}<br/>
       {/foreach}
     </p></div>
  {/foreach}
{/if}

{* print out the categories *}
{if isset($entry->categories)}
  <h4>Categories</h4>
  {foreach from=$entry->categories item='category'}
    <div class="product_detail_category"><p>
      {$mod->Lang('id')}: {$category->id}<br/>
      {$mod->Lang('name')}: {$category->name}<br/>
      {* if there are data fields associated with this category, display them too *}
      {if isset($category->data) && count($category->data)}
        <div class="product_detail_category_fields">
        <strong>{$mod->Lang('data')}</strong><br/>
        {foreach from=$category->data item='onedataitem'}
           <div class="product_detail_category_onefield">
           {if $onedataitem.field_type == 'image'}
             <a href="{$category->file_location}/{$onedataitem.field_value}"><img src="{$category->file_location}/thumb_{$onedataitem.field_value}" alt="thumb" /></a>
           {elseif $onedataitem.field_type == 'file'}
             <a href="{$category->file_location}/{$onedataitem.field_value}">{$onedataitem.field_value}</a>
           {else}
             <strong>{$onedataitem.field_prompt}</strong>: {$onedataitem.field_value}<br/>
           {/if}
           </div>
        {/foreach}
        </div>
      {/if}
    </p></div> 
  {/foreach}
{/if}

{* include the cart *}
{* include the cart *}
{cge_have_module m='CGEcommerceBase' assign='tmp'}
{if $tmp}
<div>
{cgecomm_form_addtocart product=$entry->id foo='bar'}
</div>
{/if}

{* create a link back to the top of the page *}
{anchor anchor='product_name' text=$products->Lang('return_to_top') title=$products->Lang('return_to_top')}

</div>
Thanks!

john