Post by Casperitus » Sun Oct 26, 2008 3:28 pm

Hello Everyone, that would be my first support request in here^ and i hope that i get some answers.

Anyway from a while i tried OpenCart [ AND I LIKED IT ALOT ] it's even better than any other shopping cart i know. [ AND I KNOW ALOT ].

I got so familiar with it's Skin System as a web designer, but my skills in Coding isn't that good! and i really needed to make some payment methods that suits my country [ EGYPT ]. so here is the thing.

Please review the attached image in the post. and tell me how to insert $phone_number into the database. with the order! so later i can search the database using that Variable to deliver the orders if payment was made.

oh yea one more thing, this was made based on Secure Pay method. so it's the same code just changed a view stuff and removed Payment_confirmation function because in my case i have to manually confirm it.

my next payment method should be MoneyBookers, i was wondering if someone already made it! other wise i will start working on it.

Oh yea and for the middel east people n here take a look at OneCard website! it's a new way for us to pay on the internet! i know it sux and not like Paypal! but hey it's a start from some group! cuse paypal don't accpet us!

for terrorist around the world i hope you burn in hell! [ OR Hancock PUT YOUR HEADS IN EACH OTHER AZZ ]

peace upon you all! waiting for your replies..

Attachments

???
vcash.JPG

Newbie

Posts

Joined
Mon May 05, 2008 8:53 pm

Post by bruce » Sun Oct 26, 2008 4:25 pm

Hi and welcome.

I am assuming the workflow is the same as for the securepay example so the continue button would be posting to the same form. You validate and redirect. At the point of validation, you can put the phone number in the POST into a session variable.

Code: Select all

  $session->set('order_telephone', $request->get('order_telephone', 'post'));
In catalog\controller\checkout_confirm, you would add the telephone number to the order data.

Code: Select all

  $order->set('telephone', $session->get('order_telephone'));
This causes your value to be saved in the table order_data.

In catalog\library\cart\order.php you would modify the process() function to save your variable in whatever table you want. Probably the easiest thing to do is to add it to the list of variables being saved by the statement "insert into `order` etc... You will need to add a new column in the table. The value you want will be available as

Code: Select all

$this->data['order_telephone']
if you have followed the steps above.

Good Luck.  :)

Active Member

Posts

Joined
Wed Dec 12, 2007 2:26 pm

Post by Casperitus » Mon Oct 27, 2008 9:08 am

Thanks Bruce, i think i get it now! gonna try it! and get back to you...

Newbie

Posts

Joined
Mon May 05, 2008 8:53 pm

Post by Casperitus » Mon Nov 10, 2008 1:10 pm

Hi it's me again!

Well i got it work! but it's bugged!
here is the steps :
Cart > Payments > Confirm > Vodafone Cash

Now your suggestion that i set a session in the last step. and the step before it [ Confirmation ] take that session and makes with $order-> Value.

Well since i am not good with PHP i couldn't figure out the problem that fast but that's what happened after i finish all the edits you told me to do.
I make an order with some number it store in Database but it store the previous order number, since i didn't delete the session.

So now i need your help and your mind! HOW TO MAKE IT WORKS NORMALLY!, by define the value order_phone in Vodafone Cash! not in the confirmation page.

or Even Better! if you could show me how to make the checkout progress like this
Cart > Payments > Payment Options [ Vodafone Cash ] > Confirmation > Success.

Thanks again, and sorry for screaming at you! took me like 6 hours of head pain to understand how it runs.

===========================
Edit : Well i got it to work! i just used this $this->session->get('order_phone') not $this->data['order_telephone'] in order.php and it works fine now. LOL. my first Php Project :D.

But i still would love to know if i can change the progress to this :
Cart > Payments > Payment Options [ Vodafone Cash ] > Confirmation > Success.

Cuse i have other Payments to work on!
Last edited by Casperitus on Mon Nov 10, 2008 1:24 pm, edited 1 time in total.

Newbie

Posts

Joined
Mon May 05, 2008 8:53 pm

Post by bruce » Mon Nov 10, 2008 1:51 pm

If the order_phone is persisting in the session then you need to do a

Code: Select all

$this->session->delete('order_phone');
at the end of the process() method in your payment extension, just after a successful

Code: Select all

$this->order->process();
One thing you must also address, if you have not already is related to...

The original 0.7.7 order reference was regenerated about 3 times from the point you get it till checkout confirmation. More if you go back and forward a few times. It is probably still the same in later versions of 0.7.x.

If you apply the steps outlined in this post you will find that the order reference generated will remain the same from the time you set the payment data to the time you go to checkout confirmation. You will also have the added bonus of guaranteed uniqueness rather than just a form of randomness.

oh yes, and in library/cart/order.php add the following

Code: Select all

$this->session->delete('reference'); //  This was never cleaned up.
after

Code: Select all

$this->data = array();
Cheers

Bruce

Active Member

Posts

Joined
Wed Dec 12, 2007 2:26 pm
Who is online

Users browsing this forum: No registered users and 4 guests