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: Jan 30 2025 22:23:49
Script start
Timing: Jan 30 2025 22:23:49
Module start 'layout'
Timing: Jan 30 2025 22:23:49
Module start 'content'
Timing: Jan 30 2025 22:23:49
Module end 'content'
Timing: Jan 30 2025 22:23:49
Script end

Main resources:

Total runtime0.0205 sec
Peak memory usage6,144.0000 KB
Database Queries3

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0039 588.1484151.2109
Module start 'layout' 0.00390.0031 739.3594220.6875
Module start 'content' 0.00700.0119 960.04691,005.7891
Module end 'content' 0.01890.0016 1,965.835937.9922
Script end 0.0204  2,003.8281 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.002411.6130140.0002
Check MTime0.00104.6913140.0001
Mysql Total
Database connection0.00063.003410.0006
Mysqli_queries0.00188.990330.0006
Looping result0.00000.039610.0000
Template Total0.00125.710.0012
Template load0.00104.668010.0010
Template processing0.00021.030210.0002
Override
Cache load0.00073.310710.0007
General
dbfile0.00115.191880.0001
String conversion0.00000.030340.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