Shipping cost and method changes with weight

Hi,

I just want to add weight in 4th step of order.

Here I want to display shipping methods which comes form the another website via webservice. So how can I pass weight and country to my php file from smarty code?

The order.tpl has all the variables but I cannot figure out how to pass that two variable into php code?

How can I access smarty variable in php?

I have code like this

in order.tpl file hase

        [{ oxmultilang ident="ORDER_EMAIL" }] [{ $oxcmp_user->oxuser__oxusername->value }]<br>
        [{ $oxcmp_user->oxuser__oxcompany->value }] <br>
        [{ $oxcmp_user->oxuser__oxsal->value|oxmultilangsal}] [{ $oxcmp_user->oxuser__oxfname->value }] [{ $oxcmp_user->oxuser__oxlname->value }]<br>
        [{ $oxcmp_user->oxuser__oxaddinfo->value }]<br>
        [{ $oxcmp_user->oxuser__oxstreet->value }] [{ $oxcmp_user->oxuser__oxstreetnr->value }]<br>
        [{ $oxcmp_user->getState() }]
        [{ $oxcmp_user->oxuser__oxzip->value }] [{ $oxcmp_user->oxuser__oxcity->value }]<br>
        [{ $oxcmp_user->oxuser__oxcountry->value }]<br><br>
        [{ oxmultilang ident="ORDER_PHONE" }] [{ $oxcmp_user->oxuser__oxfon->value }] <br>

And I want something like this.

[{include_php file=“client_server/getOrderDetails_client.php”}]

This getOrderDetails_client.php get the data via webservice but how can I find weight?

And how to pass this country [{ $oxcmp_user->oxuser__oxcountry->value }] as get variable into that file?

Cheers!!!

I can figure out how to assign variables in php from smarty.

this way

[{assign var=“s_country” value= $oxcmp_user->oxuser__oxcountry->value }]

and in php file you can use

$country = $this->get_template_vars(‘s_country’);

but how can I get weight for the whole basket?

The file getOrderDetails_client.php seems to be a sample implementation of the webservice, so i think the best way to use it would be to extend the appropriate core or view classes via module, implement the connection to the webservice there and then pass the variables you get from PHP to Smarty. You can find Information on how to create modules here: http://wiki.oxidforge.org/Tutorials

I will try to develop modules, but I dont know OOPS so it bit take a time for me to do it perfectly.

Can anybody tell me that how to get current (selected) shipping method on payment (3rd step)?

From where? In Step 3 (payment.php/payment.tpl) there is no direct way to get active shipping method, but in the template you can find out by stepping through all shipping sets:

[{foreach key=sShipID from=$oView->getAllSets() item=oShippingSet name=ShipSetSelect}]
<option value="[{$sShipID}]" [{if $oShippingSet->blSelected}]SELECTED[{/if}]>[{ $oShippingSet->oxdeliveryset__oxtitle->value }]</option>
[{/foreach}]

(“SELECTED” is only displayed on active shippingset)

In a module, you could do it like in order.php function getShipSet().

I made one module and there I can get that variable by

oxSession::getVar(‘sShipSet’);

:slight_smile: