Cart module get php error

Have a question or a suggestion about a 3rd party addon module or plugin?
Let us know here.
Post Reply
User avatar
sykic
New Member
New Member
Posts: 8
Joined: Wed Apr 28, 2010 11:04 am
Location: UK

Cart module get php error

Post 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
njprrogers
Forum Members
Forum Members
Posts: 30
Joined: Fri Oct 31, 2008 12:51 pm

Re: Cart module get php error

Post 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
njprrogers
Forum Members
Forum Members
Posts: 30
Joined: Fri Oct 31, 2008 12:51 pm

Re: Cart module get php error

Post 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.
scotch33
Dev Team Member
Dev Team Member
Posts: 284
Joined: Tue Feb 14, 2006 9:56 pm

Re: Cart module get php error

Post 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.
calguy1000
Support Guru
Support Guru
Posts: 8169
Joined: Tue Oct 19, 2004 6:44 pm
Location: Fernie British Columbia, Canada

Re: Cart module get php error

Post 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.
Follow me on twitter
Please post system information from "Extensions >> System Information" (there is a bbcode option) on all posts asking for assistance.
--------------------
If you can't bother explaining your problem well, you shouldn't expect much in the way of assistance.
scotch33
Dev Team Member
Dev Team Member
Posts: 284
Joined: Tue Feb 14, 2006 9:56 pm

Re: Cart module get php error

Post 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
Post Reply

Return to “Modules/Add-Ons”