Forums / General / Basket don't calculate product options

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

eZ debug

Timing: Jan 18 2025 05:11:04
Script start
Timing: Jan 18 2025 05:11:04
Module start 'content'
Timing: Jan 18 2025 05:11:05
Module end 'content'
Timing: Jan 18 2025 05:11:05
Script end

Main resources:

Total runtime0.6702 sec
Peak memory usage4,096.0000 KB
Database Queries203

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0065 587.7266180.8359
Module start 'content' 0.00660.5352 768.5625546.4844
Module end 'content' 0.54170.1284 1,315.0469342.1328
Script end 0.6701  1,657.1797 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00440.6599210.0002
Check MTime0.00160.2389210.0001
Mysql Total
Database connection0.00120.178810.0012
Mysqli_queries0.592988.46982030.0029
Looping result0.00210.30932010.0000
Template Total0.639195.420.3196
Template load0.00210.312820.0010
Template processing0.637095.046820.3185
Template load and register function0.00020.026410.0002
states
state_id_array0.00140.213710.0014
state_identifier_array0.00100.144320.0005
Override
Cache load0.00190.2819430.0000
Sytem overhead
Fetch class attribute can translate value0.00200.297130.0007
Fetch class attribute name0.00160.232860.0003
XML
Image XML parsing0.00050.071330.0002
class_abstraction
Instantiating content class attribute0.00000.002160.0000
General
dbfile0.00400.6024210.0002
String conversion0.00000.000830.0000
Note: percentages do not add up to 100% because some accumulators overlap

CSS/JS files loaded with "ezjscPacker" during request:

CacheTypePacklevelSourceFiles
CSS0extension/community/design/community/stylesheets/ext/jquery.autocomplete.css
extension/community_design/design/suncana/stylesheets/scrollbars.css
extension/community_design/design/suncana/stylesheets/tabs.css
extension/community_design/design/suncana/stylesheets/roadmap.css
extension/community_design/design/suncana/stylesheets/content.css
extension/community_design/design/suncana/stylesheets/star-rating.css
extension/community_design/design/suncana/stylesheets/syntax_and_custom_tags.css
extension/community_design/design/suncana/stylesheets/buttons.css
extension/community_design/design/suncana/stylesheets/tweetbox.css
extension/community_design/design/suncana/stylesheets/jquery.fancybox-1.3.4.css
extension/bcsmoothgallery/design/standard/stylesheets/magnific-popup.css
extension/sevenx/design/simple/stylesheets/star_rating.css
extension/sevenx/design/simple/stylesheets/libs/fontawesome/css/all.min.css
extension/sevenx/design/simple/stylesheets/main.v02.css
extension/sevenx/design/simple/stylesheets/main.v02.res.css
JS0extension/ezjscore/design/standard/lib/yui/3.17.2/build/yui/yui-min.js
extension/ezjscore/design/standard/javascript/jquery-3.7.0.min.js
extension/community_design/design/suncana/javascript/jquery.ui.core.min.js
extension/community_design/design/suncana/javascript/jquery.ui.widget.min.js
extension/community_design/design/suncana/javascript/jquery.easing.1.3.js
extension/community_design/design/suncana/javascript/jquery.ui.tabs.js
extension/community_design/design/suncana/javascript/jquery.hoverIntent.min.js
extension/community_design/design/suncana/javascript/jquery.popmenu.js
extension/community_design/design/suncana/javascript/jScrollPane.js
extension/community_design/design/suncana/javascript/jquery.mousewheel.js
extension/community_design/design/suncana/javascript/jquery.cycle.all.js
extension/sevenx/design/simple/javascript/jquery.scrollTo.js
extension/community_design/design/suncana/javascript/jquery.cookie.js
extension/community_design/design/suncana/javascript/ezstarrating_jquery.js
extension/community_design/design/suncana/javascript/jquery.initboxes.js
extension/community_design/design/suncana/javascript/app.js
extension/community_design/design/suncana/javascript/twitterwidget.js
extension/community_design/design/suncana/javascript/community.js
extension/community_design/design/suncana/javascript/roadmap.js
extension/community_design/design/suncana/javascript/ez.js
extension/community_design/design/suncana/javascript/ezshareevents.js
extension/sevenx/design/simple/javascript/main.js

Templates used to render the page:

UsageRequested templateTemplateTemplate loadedEditOverride
1node/view/full.tplfull/forum_topic.tplextension/sevenx/design/simple/override/templates/full/forum_topic.tplEdit templateOverride template
5content/datatype/view/ezxmltext.tpl<No override>extension/community_design/design/suncana/templates/content/datatype/view/ezxmltext.tplEdit templateOverride template
10content/datatype/view/ezxmltags/paragraph.tpl<No override>extension/ezwebin/design/ezwebin/templates/content/datatype/view/ezxmltags/paragraph.tplEdit templateOverride template
2content/datatype/view/ezxmltags/line.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/line.tplEdit templateOverride template
4content/datatype/view/ezxmltags/literal.tpl<No override>extension/community/design/standard/templates/content/datatype/view/ezxmltags/literal.tplEdit templateOverride template
1pagelayout.tpl<No override>extension/sevenx/design/simple/templates/pagelayout.tplEdit templateOverride template
 Number of times templates used: 23
 Number of unique templates used: 6

Time used to render debug report: 0.0002 secs