Announcement

Collapse
No announcement yet.

Order Script

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Order Script

    I have semi-successfully managed to edit the orderscript.pl so that additional variables are displayed in the customer emails.

    #
    # Add product line
    #
    MailOrderLine( $$pProduct{REFERENCE},
    $$pProduct{NAME}. "\r\nLead Time: " . $$pProduct{"CUSTOMVARS"}{'LeadTime'}. "\r\nAvailable Ex Stock: " . $$pProduct{"CUSTOMVARS"}{'DeltaStock'},
    $$pOrderDetail{QUANTITY},
    $CurrentItem{'PRICE'},
    $CurrentItem{'COST'},
    $nDescriptionColumnWidth,
    @TableFormat
    );


    But I want the same to happen to the component products but I keep getting 0 values displayed:


    #
    # Add component line
    #
    MailOrderLine( $pComponent->{'REFERENCE'},
    $pComponent->{'NAME'}. "\r\nLead Time: " . $$pProduct{"CUSTOMVARS"}{'LeadTime'}. "\r\nAvailable Ex Stock: " . $$pProduct{"CUSTOMVARS"}{'DeltaStock'},
    $pComponent->{'QUANTITY'},
    $pComponent->{'PRICE'},
    $pComponent->{'COST'},
    $nDescriptionColumnWidth,
    @TableFormat
    );

    If I use $pComponent here instead the script fails with a CGI Header error:

    Mail email shows:

    PA1AX CONCAVE HEAD Heavy spring 10 £1.61 £16.10
    Lead Time: 0
    Available Ex Stock: 0

    PA1AS-012 REDUCED CONCAVE Light spring 1 £1.61 £1.61
    Lead Time: 14
    Available Ex Stock: 426


    The first line is a component and the second a striaght forward product.

    I guess I using the wrong $p...... but cannot get what I expect to be work.

    Any ideas greatfully accepted.


    Gilbo

    #2
    Hi,

    This is really outside the scope of support as it will require a large change but I asked the development team if what you were trying was possible and had the following response from them (I hope you understand it more than I do ):

    ******
    It's a lot more complicated for associated products then for ordinary products.

    Although the variables are stored in the A*.cat blobs for the associated products the scripts do not support the retrieval of data at that level so there is no supporting code in ACTINIC::GetHierarchicalCustomVar() for the variable of the associated products.

    The above can be worked round only if the variables are set at product level and do not have 'use parent' set.

    OrderScript uses an array @aComponentsIncluded. Each element of the array is a hash of component data. The additional variables to be displayed first need to be stored in the array which is built in ActinicOrder::PreprocessCartToDisplay() this in turn uses ActinicOrder::FindComponent() to locate the component data. None of the component custom variables are handled by these routines so it would be necessary to add the code in ActinicOrder::FindComponent() to put the custom variables into the data table $res and then in ActinicOrder::PreprocessCartToDisplay() copy the custom variable data returned by ActinicOrder::FindComponent() to $hComponentItem then the variables will be available in OrderScript array @aComponentsIncluded.

    ----------------------------------
    BTW The Price and Cost have been changed for the components from...

    $sPrice,
    $sCost,

    to...

    $pComponent->{'PRICE'},
    $pComponent->{'COST'},

    The above change should be undone.
    ----------------------------------
    ********
    ********************
    Tracey
    SellerDeck

    Comment


      #3
      Bish Bash Bosh, "Cha Ching" as the Fisher Price till rolls into action.

      Comment

      Working...
      X