- Posts: 107
- Thank you received: 1
How to add a new payment or shipping method?
13 years 10 months ago - 13 years 10 months ago #78729
by tinachou
How to add a new payment or shipping method? was created by tinachou
Hi there,
I need to add an additional payment method called " pay at the convenient store" like 7-11.
That means the ordered things will be sent to the convenient store that specified by the consumer;
once the ordered things arrive at the convenient store,
the consumer will get a reminding message from the seller
so the consumer can then go to the convenient store to pay the bill and get the things.
There is an online service which offers an API that developers can pass the required parameters to the application service
and it will send back some necessary info.
The example code is here : www.ezship.com.tw/emap/ezship_simulation_request_code_big5.html
However, I don't know how and where can I add this additional payment plugin into Hikashop and make it appear as a payment option?
Please help me to configure this.
Thank you so much.
I need to add an additional payment method called " pay at the convenient store" like 7-11.
That means the ordered things will be sent to the convenient store that specified by the consumer;
once the ordered things arrive at the convenient store,
the consumer will get a reminding message from the seller
so the consumer can then go to the convenient store to pay the bill and get the things.
There is an online service which offers an API that developers can pass the required parameters to the application service
and it will send back some necessary info.
The example code is here : www.ezship.com.tw/emap/ezship_simulation_request_code_big5.html
However, I don't know how and where can I add this additional payment plugin into Hikashop and make it appear as a payment option?
Please help me to configure this.
Thank you so much.
Last edit: 13 years 10 months ago by tinachou.
Please Log in or Create an account to join the conversation.
13 years 10 months ago #78750
by Jerome
Jerome - Obsidev.com
HikaMarket & HikaSerial developer / HikaShop core dev team.
Replied by Jerome on topic How to add a new payment or shipping method?
Hi,
I think you want to use the "collect on delivery" payment plugin.
If you want to use several times this plugin, you would have to duplicate it.
The duplication requires some little development skills in order to create a valid zip with duplicated files.
We don't have a plugin for "ezship" but with some developpment skills, you can implement it.
www.hikashop.com/en/support/documentatio...r-documentation.html
I don't understand if "ezship" is a shipping or a payment method but HikaShop plugins are Joomla plugins with some specific triggers.
Creating a plugin for HikaShop is like creating a plugin for Joomla. If you want to install an HikaShop plugin, you would use the Joomla Extension manager.
Regards,
I think you want to use the "collect on delivery" payment plugin.
If you want to use several times this plugin, you would have to duplicate it.
The duplication requires some little development skills in order to create a valid zip with duplicated files.
We don't have a plugin for "ezship" but with some developpment skills, you can implement it.
www.hikashop.com/en/support/documentatio...r-documentation.html
I don't understand if "ezship" is a shipping or a payment method but HikaShop plugins are Joomla plugins with some specific triggers.
Creating a plugin for HikaShop is like creating a plugin for Joomla. If you want to install an HikaShop plugin, you would use the Joomla Extension manager.
Regards,
Jerome - Obsidev.com
HikaMarket & HikaSerial developer / HikaShop core dev team.
The following user(s) said Thank You: tinachou
Please Log in or Create an account to join the conversation.
13 years 10 months ago - 13 years 10 months ago #79640
by tinachou
Replied by tinachou on topic How to add a new payment or shipping method?
Dear Jerome,
Thank you for your insightful reply.
As you say, may I zip the directory "plg_hikashoppayment_collectondelivery" as :
and install duplicate "plg_hikashoppayment_collectondelivery" to Joomla website through "extension manager"?
Then, try to modify the included files as:
Are the above steps correct?
If yes, then, since there are four php files, Which php file should I add additional code into?
EZSHIP offers an API : " www.ezship.com.tw/emap/rv_request_web.jsp " and uses the method "post".
Their API requires the following parameters:
I wonder what are the corresponding parameters of Hikashop side?
What are the return URL and webtemp for Hikashop? I am confused.
My most appreciation.
Thank you for your insightful reply.
As you say, may I zip the directory "plg_hikashoppayment_collectondelivery" as :
and install duplicate "plg_hikashoppayment_collectondelivery" to Joomla website through "extension manager"?
Then, try to modify the included files as:
Are the above steps correct?
If yes, then, since there are four php files, Which php file should I add additional code into?
EZSHIP offers an API : " www.ezship.com.tw/emap/rv_request_web.jsp " and uses the method "post".
Their API requires the following parameters:
- su_id = shop owner's ezShip account
- order_id = order ID
- rturl = return url
- rv_name = customer's name
- rv_email = customer's email
- rv_mobil = customer's mobile phone number
- rv_amount = 2000 or 0. (If customer will pay at the convenient store, then rv_amount=2000;
- webtemp = Some other parameters required by Hikashop web application for logic handling.
if customer will not pay at the convenient store, then rv_amount=0.)
I wonder what are the corresponding parameters of Hikashop side?
What are the return URL and webtemp for Hikashop? I am confused.
My most appreciation.
Last edit: 13 years 10 months ago by tinachou.
Please Log in or Create an account to join the conversation.
13 years 10 months ago #79743
by Jerome
Jerome - Obsidev.com
HikaMarket & HikaSerial developer / HikaShop core dev team.
Replied by Jerome on topic How to add a new payment or shipping method?
Hi,
It's a little bit different.
If you're working directly in your joomla instance. You can copy the directory, rename it to "plg_hikashopshipping_collectondelivery2" and rename files into using the same method.
After that, you have to edit the xml files and some PHP files in order to replace "collectondelivery" by "collectondelivery2".
When your plugin would be ready, you would be able to use the "discovery" feature in Jooma extension manager.
Your new plugin should appear and you would be able to install it.
Regards,
It's a little bit different.
If you're working directly in your joomla instance. You can copy the directory, rename it to "plg_hikashopshipping_collectondelivery2" and rename files into using the same method.
After that, you have to edit the xml files and some PHP files in order to replace "collectondelivery" by "collectondelivery2".
When your plugin would be ready, you would be able to use the "discovery" feature in Jooma extension manager.
Your new plugin should appear and you would be able to install it.
Regards,
Jerome - Obsidev.com
HikaMarket & HikaSerial developer / HikaShop core dev team.
Please Log in or Create an account to join the conversation.
13 years 10 months ago #79768
by tinachou
Replied by tinachou on topic How to add a new payment or shipping method?
Dear,
I rename the directory and re-edit the corresponding files. I put the new "collectondelivery2" under website\plugins\hikashoppayment.
However,when I use "discovery" function, there is no files being found.
What should I do now?
Really really thank you.
I rename the directory and re-edit the corresponding files. I put the new "collectondelivery2" under website\plugins\hikashoppayment.
However,when I use "discovery" function, there is no files being found.
What should I do now?
Really really thank you.
Please Log in or Create an account to join the conversation.
13 years 10 months ago #79808
by tinachou
Replied by tinachou on topic How to add a new payment or shipping method?
hi there,
I have to send the parameters of customer's name, email, and phone number to EZSHIP's API.
I wonder how can I get the user's email, name, and phone number in Hikashop. Which function should I use?
I did some check, and found out
$user_id = hikashop_loadUser();
But this is for user's id. How can I get the other information of users?
Thank you so much.
I have to send the parameters of customer's name, email, and phone number to EZSHIP's API.
I wonder how can I get the user's email, name, and phone number in Hikashop. Which function should I use?
I did some check, and found out
$user_id = hikashop_loadUser();
But this is for user's id. How can I get the other information of users?
Thank you so much.
Please Log in or Create an account to join the conversation.
13 years 10 months ago #79875
by Jerome
Jerome - Obsidev.com
HikaMarket & HikaSerial developer / HikaShop core dev team.
Replied by Jerome on topic How to add a new payment or shipping method?
Hi,
If you want to see how load user info and address info, the best is to read source code of other payment plugins, like "paypal" or other.
Regards,
If you want to see how load user info and address info, the best is to read source code of other payment plugins, like "paypal" or other.
Code:
$address_type = 'shipping_address'; // or 'billing_address'
$app =& JFactory::getApplication();
$address = $app->getUserState( HIKASHOP_COMPONENT.'.'.$address_type);
$cart = hikashop_get('class.cart');
$cart->loadAddress($order->cart, $address, 'object', 'shipping'); // or 'billing'
£first_name = @$order->cart->$address_type->address_firstname;
£last_name = @$order->cart->$address_type->address_lastname;
// etc
Regards,
Jerome - Obsidev.com
HikaMarket & HikaSerial developer / HikaShop core dev team.
Please Log in or Create an account to join the conversation.
13 years 10 months ago - 13 years 10 months ago #79900
by tinachou
Replied by tinachou on topic How to add a new payment or shipping method?
Dear J,
I am very thankful for your hints. I have finished the API connection.
Currently I overwrote the original "collectondelivery" plugin for test.
But I have to make a new plugin for ezship because "collectondelivery" itself is also a payment option too.
I have tried the method you mentioned by the "discovery" function of extension manager. However, the function cannot work. (I put the "collectondelivery2" in the same directory as "collectondelivery" plugin.) Joomla just cannot find it.
Is there any alternative way to install the plugin?
I am very thankful for your hints. I have finished the API connection.
Code:
$user = hikashop_loadUser(true);
$address_type = 'billing_address'; // or 'billing_address'
$app =& JFactory::getApplication();
$address = $app->getUserState( HIKASHOP_COMPONENT.'.'.$address_type);
$cart = hikashop_get('class.cart');
$cart->loadAddress($order->cart, $address, 'object', 'billing'); // or 'billing'
$vars["name"]=@$order->cart->$address_type->address_firstname;
$vars["phone"]=@$order->cart->$address_type->address_telephone;
$vars["email"]=$user->user_email;
Currently I overwrote the original "collectondelivery" plugin for test.
But I have to make a new plugin for ezship because "collectondelivery" itself is also a payment option too.
I have tried the method you mentioned by the "discovery" function of extension manager. However, the function cannot work. (I put the "collectondelivery2" in the same directory as "collectondelivery" plugin.) Joomla just cannot find it.
Is there any alternative way to install the plugin?
Last edit: 13 years 10 months ago by tinachou.
Please Log in or Create an account to join the conversation.
13 years 10 months ago #79966
by nicolas
Replied by nicolas on topic How to add a new payment or shipping method?
You can zip the files of your plugin and install it like a normal extension via the joomla installer.
Please Log in or Create an account to join the conversation.
Time to create page: 0.342 seconds