How to get an option field value

Author Message

Albert Hornos

Tuesday 24 May 2005 1:37:05 am

Hi I extend the ezoption datatype to incrase the number of fields.
Now my ezoption looks like this

Option + Extra + Date + Additional Price + Quantity.

And the problem is that I need extend the simpleshipping workflow to decrease Quantity but I can't acces to this field.

Albert Hornos

Wednesday 25 May 2005 3:04:20 am

OK Here are more information about my problem. Now I've arrived exactly where I want but now I don't know how to change the option field.
This is the code for my event. The event run after confirm order and his function is decrease "quantity" in the product attribute "option".


function execute( &$process, &$event )
    {
        $ini =& eZINI::instance( 'workflow.ini' );

        $cost = $ini->variable( "DecreaseQuantityWorkflow", "ShippingCost" );
        $description = $ini->variable( "DecreaseQuantity", "DecreaseDescription" );

        $parameters = $process->attribute( 'parameter_list' );
        $orderID = $parameters['order_id'];

        $order =& eZOrder::fetch( $orderID );

//I take the ordered item to decrease the quantity
        $productCollection = $order->productCollection();
        $ordereditems = $productCollection->itemList();
        foreach ($ordereditems as $item){
          $contentObject = $item->contentObject();
					$aux =& $item->optionList();
          $contentObjectVersion =& $contentObject->version( $contentObject->attribute( 'current_version' ) );
          $contentObjectAttributes =& $contentObjectVersion->contentObjectAttributes();
          foreach (array_keys($contentObjectAttributes) as $key){
            $contentObjectAttribute =& $contentObjectAttributes[$key];
            $contentClassAttribute =& $contentObjectAttribute->contentClassAttribute();
            if ($contentClassAttribute->attribute("name") == "Fecha_Hora_Precio"){
						print_r($contentObjectAttribute);
              $aux2 = & eZOptionType::objectAttributeContent($contentObjectAttribute);
							$aux3 =& $aux2->Options;
              foreach ($aux3 as $opcion){
								if ($aux[0]->OptionItemID == $opcion[id]){
//Here I should decrease and store.
								}
							}
             
            }
          }
        }
    }

Could anyone help me? It's so urgent.
Thanks for your attention.

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 18 2025 21:16:10
Script start
Timing: Jan 18 2025 21:16:10
Module start 'layout'
Timing: Jan 18 2025 21:16:10
Module start 'content'
Timing: Jan 18 2025 21:16:11
Module end 'content'
Timing: Jan 18 2025 21:16:11
Script end

Main resources:

Total runtime0.8033 sec
Peak memory usage4,096.0000 KB
Database Queries52

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0060 589.3594152.6250
Module start 'layout' 0.00600.0031 741.984439.4453
Module start 'content' 0.00900.7925 781.4297429.3281
Module end 'content' 0.80150.0017 1,210.75788.1563
Script end 0.8033  1,218.9141 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00340.4247160.0002
Check MTime0.00130.1585160.0001
Mysql Total
Database connection0.00100.129310.0010
Mysqli_queries0.759194.4994520.0146
Looping result0.00120.1523500.0000
Template Total0.767595.520.3838
Template load0.00240.295220.0012
Template processing0.765195.247920.3826
Template load and register function0.00020.027110.0002
states
state_id_array0.00100.121410.0010
state_identifier_array0.00090.111320.0004
Override
Cache load0.00180.2229130.0001
Sytem overhead
Fetch class attribute can translate value0.00070.091610.0007
Fetch class attribute name0.00090.115420.0005
XML
Image XML parsing0.00020.030310.0002
class_abstraction
Instantiating content class attribute0.00000.001020.0000
General
dbfile0.00070.0829100.0001
String conversion0.00000.000940.0000
Note: percentages do not add up to 100% because some accumulators overlap

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
2content/datatype/view/ezxmltext.tpl<No override>extension/community_design/design/suncana/templates/content/datatype/view/ezxmltext.tplEdit templateOverride template
3content/datatype/view/ezxmltags/line.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/line.tplEdit templateOverride template
3content/datatype/view/ezxmltags/paragraph.tpl<No override>extension/ezwebin/design/ezwebin/templates/content/datatype/view/ezxmltags/paragraph.tplEdit templateOverride template
1content/datatype/view/ezxmltags/literal.tpl<No override>extension/community/design/standard/templates/content/datatype/view/ezxmltags/literal.tplEdit templateOverride template
1print_pagelayout.tpl<No override>extension/community/design/community/templates/print_pagelayout.tplEdit templateOverride template
 Number of times templates used: 11
 Number of unique templates used: 6

Time used to render debug report: 0.0001 secs