Anyone ?
Anyone ?
Me again. If I read $order in the Atos module, I get this :
whereas doing the same thing with the Paypal module, I get thisPHP Code:
order Object
(
[info] => Array
(
[order_status] => 1
[currency] => EUR
[currency_value] => 1.00000000
[payment_method] =>
[payment_module_code] =>
[coupon_code] =>
[shipping_method] => Frais de Livraison (Montant)
[shipping_module_code] => flat_flat
[shipping_cost] => 60
[subtotal] => 955
[tax] => 0
[total] => 1015
[tax_groups] => Array
(
[Taux de Taxes Inconnu] => 0
)
[comments] =>
[ip_address] => XXXXXXXXX - XXXXXXXXXXXXX
)
The two [total] fields send different values. Why ? I want the Atos module to pick up the same total as Paypal, ie the deposit due when the order is placed. How can I get the Atos module to behave in the same way as Paypal's ?PHP Code:
order Object
(
[info] => Array
(
[order_status] => 1
[currency] => EUR
[currency_value] => 1.00000000
[payment_method] =>
[payment_module_code] =>
[coupon_code] =>
[shipping_method] => Frais de Livraison (Montant)
[shipping_module_code] => flat_flat
[shipping_cost] => 60
[subtotal] => 955
[tax] => 0
[total] => 346.5
[tax_groups] => Array
(
[Taux de Taxes Inconnu] => 0
)
[comments] =>
[ip_address] => XXXXXXXXXXXXXXXX - XXXXXXXXXXXXXXX
)
Cheers
Pete
Is there anywhere in the forums where we could submit php code problems ? I'm not talking about anything vastly complicated because there are specialist forums out there but it would be nice if we could post a snippet or two so as to obtain some quick advice from fellow Zen users !
Cheers
Pete
This facility already exists
i.e.
when posting message, require code insert,
click hash key icon..WRAP code tags around
selected text.
I know the wrap-around function exists but what I meant was is there a specific place to post ? There doesn't appear to be.
I have a problem with a piece of code but will make one or two more tests before posting here.
Cheers
Pete
Simple for the php savvies really : in a payment module, for orders having a value of >200, I want 30% of the order to be sent to the bank. For the rest, 100% of the order is due. Here is the code (which doesn't work) :
Only the first part of the code, ie:PHP Code:
$sips = $this->makeRequest($order->info['total'], $currency);
if ($sips > 200) {
echo $sips = $this->makeRequest($order->info['total']*0.30, $currency);
} else {
echo $sips = $this->makeRequest($order->info['total'], $currency);
}
echo '">'."\n";
works, the second part, ie :PHP Code:
echo $sips = $this->makeRequest($order->info['total']*0.30, $currency);
doesn't. Why not ?PHP Code:
echo $sips = $this->makeRequest($order->info['total'], $currency);
}
How about separating out the assignment and the echo by changing the whole thing to:
PHP Code:
$sips = $this->makeRequest($order->info['total'], $currency);
if ($sips > 200) {
$sips = number_format($sips*0.30,2);
}
echo $sips . '">'."\n";
Kuroi Web Design and Development | Twitter
(Questions answered in the forum only - so that any forum member can benefit - not by personal message)
Thanks. Unfortunately that doesn't work either. In fact, its even worse. Another board, someone told me that I must && statements without saying how. As I only have one variable - $sips - I don't what I'm supposed to compare with it. I'll get there in the end but this is a tad frustrating !
What do you think ?
Cheers
I see in the payment modules that this line is what fishes out the order amount. The question is : where does the info come from, ie which files ? I ask the question because I need to add an if...else statement so that only 30% of orders over 200 Euros are debited. I've added the statement to the Paypal module and it works but it doesn't work with the custom module : 30% is debitted whether the order exceeds 200 Euros or not.
The custom payment module's order info line isWhereas Paypal's isPHP Code:
$sips = $this->makeRequest($order->info['total'], $currency);
They look similar to me !PHP Code:
$this->totalsum = $order->info['total'];
Thanks
Pete
How many more threads are you going to open on the same question?
And, which payment module is this for now? You've been talking about paypal, atos, payline ... how many modules are you altering? How many modules do you need to run on your site?
Having your disjointed questions scattered all over makes it hard to follow the "why" behind your posts. And, frankly, when I see that, I click "next" and move on to another topic, ignoring yours.
So ... you might reconsider your approach.
.
Zen Cart - putting the dream of business ownership within reach of anyone!
Donate to: DrByte directly or to the Zen Cart team as a whole
Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.
Bookmarks