Basket don't calculate product options

Author Message

Evandro Pastor

Tuesday 23 May 2006 8:05:28 pm

Hello!

I've trying to setup a on-line shop. I've to create another page for products using this tutorial:

http://www.sitepoint.com/article/ecommerce-website-ez-publish

For your understanding the issue: I've a lot of products like this:

1) socks
size: 1, 2, 3
colors: white, blue, gray, orange
price: XXX

When a client choose more options for these socks, in the basket only display one product.

I whant to display one product whith color per line, and calculate that.

This is a model create based in my custom products:

<h1>{$node.name}</h1>

Nome
{attribute_view_gui attribute=$node.object.data_map.nome}

Descricao
{attribute_view_gui attribute=$node.object.data_map.description}

<h2>Opcoes</h2>
{attribute_view_gui attribute=$node.object.data_map.opcoes}

Imagem
{attribute_view_gui attribute=$node.object.data_map.imagem}

<h2>Preco</h2>
{attribute_view_gui attribute=$node.object.data_map.preco}



<form method="post" action={"content/action"|ezurl}>
  <input type="submit" class="defaultbutton"  
         name="ActionAddToBasket"  
         value="{"Add to basket"|i18n("design/base")}" />
  <input type="hidden" name="ContentNodeID" value="{$node.node_id}" />
  <input type="hidden" name="ContentObjectID" value="{$node.object.id}" />
  <input type="hidden" name="ViewMode" value="full" />
</form>

Anyone have any idea to do that?

ps: sorry about my english :)

bisk

Wednesday 24 May 2006 1:18:09 am

Try to put the options inside the form tags.

So a part of your code will have to be something like this:

<form method="post" action={"content/action"|ezurl}>

{attribute_view_gui attribute=$node.object.data_map.your_options}

<input type="submit" class="defaultbutton"  name="ActionAddToBasket"  value="{"Add to basket"|i18n("design/base")}" />
<input type="hidden" name="ContentNodeID" value="{$node.node_id}" />
<input type="hidden" name="ContentObjectID" value="{$node.object.id}" />
<input type="hidden" name="ViewMode" value="full" />
</form> 

I've done something similar a few days ago.

-------------------------------
http://www.kookfijn.nl & http://www.magento.be

Evandro Pastor

Wednesday 24 May 2006 9:21:52 am

Hello bisk!

Thanks for your tip! It's working perfectly!

But I've another problem:

in pending order;
email sended to client;
and im the order control, in control panel

dont apper these options itens. In the order only have a one line with total number of itens for all options from the same product.

Does the procedure that you described decides this new problem? Do I have to do any other procedure?

ps.: again, sorry about my english :)

Evandro Pastor

Wednesday 24 May 2006 10:01:11 am

bisk

Wednesday 24 May 2006 1:27:54 pm

dont apper these options itens. In the order only have a one line with total number of itens for all options from the same product.

Sorry, but I don't exactly understand what you mean.

For example in "email sended to client;" the options do not show up, because the code used in the template only loops through the ordered products but does not loop through the options of each ordered product. So for orderemail.tpl you will have to create an override template.

So for example for orderemail.tpl replace some of it's default code with something like this:

Your order:
{section var=product_item loop=$order.product_items}

{$product_item.item_count}x {$product_item.object_name} {$product_item.price_inc_vat|l10n(currency)}

{section show=$product_item.item.item_object.option_list}

With the options:
{section var=product_options loop=$product_item.item_object.option_list}

{$product_options.name}: {$product_options.value} {section show=$product_options.price|ne( 0 )}{$product_options.price|l10n( currency )} {/section}

{/section}


{/section}
{/section}
     
Product Total: {$order.product_total_inc_vat|l10n(currency)}
{section var=order_item loop=$order.order_items show=$order.order_items}
{$order_item.description}: {$order_item.price_inc_vat|l10n(currency)}
{/section}

Order Total: {$order.total_inc_vat|l10n(currency)}

In the admin area or the control panel, the options should show up by default I think. Click on the order id. If they do not show up, there might be a problem somewhere else.

Let me know if you have any problems.

-------------------------------
http://www.kookfijn.nl & http://www.magento.be

Evandro Pastor

Thursday 25 May 2006 7:36:16 am

Your tip worked perfectly :) Thanks for you help. And again, sorry about my english :D

Powered by eZ Publish™ CMS Open Source Web Content Management. Copyright © 1999-2014 eZ Systems AS (except where otherwise noted). All rights reserved.

eZ debug

Timing: Feb 16 2025 04:19:08
Script start
Timing: Feb 16 2025 04:19:08
Module start 'layout'
Timing: Feb 16 2025 04:19:08
Module start 'content'
Timing: Feb 16 2025 04:19:08
Module end 'content'
Timing: Feb 16 2025 04:19:08
Script end

Main resources:

Total runtime0.0157 sec
Peak memory usage2,048.0000 KB
Database Queries3

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0045 590.8594151.2031
Module start 'layout' 0.00450.0030 742.062536.6484
Module start 'content' 0.00750.0068 778.710998.1406
Module end 'content' 0.01430.0013 876.851637.9922
Script end 0.0156  914.8438 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.003018.8546140.0002
Check MTime0.00159.4600140.0001
Mysql Total
Database connection0.00063.990410.0006
Mysqli_queries0.002213.742630.0007
Looping result0.00000.089810.0000
Template Total0.00106.410.0010
Template load0.00085.183510.0008
Template processing0.00021.225110.0002
Override
Cache load0.00063.880810.0006
General
dbfile0.002818.186580.0004
String conversion0.00000.038040.0000
Note: percentages do not add up to 100% because some accumulators overlap

Templates used to render the page:

UsageRequested templateTemplateTemplate loadedEditOverride
1print_pagelayout.tpl<No override>extension/community/design/community/templates/print_pagelayout.tplEdit templateOverride template
 Number of times templates used: 1
 Number of unique templates used: 1

Time used to render debug report: 0.0001 secs