- Posts: 575
- Thank you received: 11
Delivery charges on public holiday and deliver tim
- ler@singmuiheng.com
-
Topic Author
- Offline
Less
More
11 years 3 weeks ago #215937
by ler@singmuiheng.com
-- HikaShop version -- : 2.5.0
-- Joomla version -- : 3.4.4
-- PHP version -- : 5.4.40
Hi, we added different zone charges for shipping method
And now we added two custom field , advance date picker and dropdown for time selection
All are working fine for different shipping cost on each zone, time and date are also shown in order
But we would like to have extra charges when the date is Sunday or public holiday
And another extra charges on timing ? Eg 6-8pm +$30, 8-11pm +$80, 12am +$120
Is it possible to do that on current version without much tweak ?
Or can we use jquery to change the zone chargea during date and time selection ?
-- Joomla version -- : 3.4.4
-- PHP version -- : 5.4.40
Hi, we added different zone charges for shipping method
And now we added two custom field , advance date picker and dropdown for time selection
All are working fine for different shipping cost on each zone, time and date are also shown in order
But we would like to have extra charges when the date is Sunday or public holiday
And another extra charges on timing ? Eg 6-8pm +$30, 8-11pm +$80, 12am +$120
Is it possible to do that on current version without much tweak ?
Or can we use jquery to change the zone chargea during date and time selection ?
Please Log in or Create an account to join the conversation.
11 years 3 weeks ago #215941
by nicolas
Replied by nicolas on topic Delivery charges on public holiday and deliver tim
Hi,
The best would be to develop a small plugin in order to add an additional fee entry based on what is entered in the custom field.
If you're a developer, you can look at this plugin for how to develop such additional fee plugin:
www.hikashop.com/forum/taxes/873285-fix-tax-import.html#190511
And to load the data from the custom field in your plugin, it's really easy:
$app = JFactory::getApplication();
$fields_data = $app->getUserState( HIKASHOP_COMPONENT.'.checkout_fields');
It will be easier and cleaner than using jquery to change the zone and adapt the zones using code hacks around HikaShop.
The best would be to develop a small plugin in order to add an additional fee entry based on what is entered in the custom field.
If you're a developer, you can look at this plugin for how to develop such additional fee plugin:
www.hikashop.com/forum/taxes/873285-fix-tax-import.html#190511
And to load the data from the custom field in your plugin, it's really easy:
$app = JFactory::getApplication();
$fields_data = $app->getUserState( HIKASHOP_COMPONENT.'.checkout_fields');
It will be easier and cleaner than using jquery to change the zone and adapt the zones using code hacks around HikaShop.
Please Log in or Create an account to join the conversation.
- ler@singmuiheng.com
-
Topic Author
- Offline
Less
More
- Posts: 575
- Thank you received: 11
11 years 2 weeks ago - 11 years 2 weeks ago #216541
by ler@singmuiheng.com
Replied by ler@singmuiheng.com on topic Delivery charges on public holiday and deliver tim
$fields_data = $app->getUserState( HIKASHOP_COMPONENT.'.checkout_fields');
got some problem on this
we try to see if our custom field are in the output of $fields_data but it is empty
got some problem on this
we try to see if our custom field are in the output of $fields_data but it is empty
Last edit: 11 years 2 weeks ago by ler@singmuiheng.com.
Please Log in or Create an account to join the conversation.
- ler@singmuiheng.com
-
Topic Author
- Offline
Less
More
- Posts: 575
- Thank you received: 11
11 years 2 weeks ago #216542
by ler@singmuiheng.com
Replied by ler@singmuiheng.com on topic Delivery charges on public holiday and deliver tim
We found the problem, now we got the field data
but the when user filling up the custom field, the data are not refresh immediately, it only got the data after user select shipping method
any method to optimize this?
but the when user filling up the custom field, the data are not refresh immediately, it only got the data after user select shipping method
any method to optimize this?
Please Log in or Create an account to join the conversation.
- ler@singmuiheng.com
-
Topic Author
- Offline
Less
More
- Posts: 575
- Thank you received: 11
11 years 2 weeks ago #216575
by ler@singmuiheng.com
Replied by ler@singmuiheng.com on topic Delivery charges on public holiday and deliver tim
Dear Nicolas
I think we are almost there, we have managed to update the additional charges by multiple custom field with correct charges and final price (we corrected the price_value_with_tax in the example plugin)
but we found that the tax amount shown in cart are missing the value of these custom field charges
May i check with you how can we update the checkout_fields , tax_amount ? is there a ready function for that?
I think we are almost there, we have managed to update the additional charges by multiple custom field with correct charges and final price (we corrected the price_value_with_tax in the example plugin)
but we found that the tax amount shown in cart are missing the value of these custom field charges
May i check with you how can we update the checkout_fields , tax_amount ? is there a ready function for that?
Please Log in or Create an account to join the conversation.
11 years 2 weeks ago #216581
by nicolas
Replied by nicolas on topic Delivery charges on public holiday and deliver tim
Hi,
What code are you using ?
Based on the method you use, my answer will be different.
What code are you using ?
Based on the method you use, my answer will be different.
Please Log in or Create an account to join the conversation.
- ler@singmuiheng.com
-
Topic Author
- Offline
Less
More
- Posts: 575
- Thank you received: 11
11 years 2 weeks ago #216686
by ler@singmuiheng.com
Replied by ler@singmuiheng.com on topic Delivery charges on public holiday and deliver tim
Dear Nicolas
we are using the same code as in
www.hikashop.com/forum/taxes/873285-fix-tax-import.html#190511
but we do if else clause base on what is selected on custom field
and make calculation to price with tax
then change the $additional array
$additional->price_currency_id = hikashop_getCurrency();;
$additional->price_value = if custom field value 80 {80};
$additional->price_value_with_tax = if custom field value 80 {80*1.06};
$cart->additional = $additional;
however, all are updated well, except tax_amount, wonder if we could just add tax_amount in the additional array
and is it possible to archive currency conversion for these amount? any sample code to refer?
We will release this additional fee full plugin after complete and fully tested
we are using the same code as in
www.hikashop.com/forum/taxes/873285-fix-tax-import.html#190511
but we do if else clause base on what is selected on custom field
and make calculation to price with tax
then change the $additional array
$additional->price_currency_id = hikashop_getCurrency();;
$additional->price_value = if custom field value 80 {80};
$additional->price_value_with_tax = if custom field value 80 {80*1.06};
$cart->additional = $additional;
however, all are updated well, except tax_amount, wonder if we could just add tax_amount in the additional array
and is it possible to archive currency conversion for these amount? any sample code to refer?
We will release this additional fee full plugin after complete and fully tested
Please Log in or Create an account to join the conversation.
11 years 2 weeks ago #216687
by nicolas
Replied by nicolas on topic Delivery charges on public holiday and deliver tim
Hi,
If you look at our change log, you can see this:
And I can see that you're using HikaShop 2.5.0 and that you're using the additionals system in order to add your custom fee.
So it's normal that the taxes of your additionals aren't taken into account.
You'll have to update to HikaShop 2.6.0 for that to work.
If you look at our change log, you can see this:
as a new feature of HikaShop 2.6.0We added the support of the taxes in the order additionals system
And I can see that you're using HikaShop 2.5.0 and that you're using the additionals system in order to add your custom fee.
So it's normal that the taxes of your additionals aren't taken into account.
You'll have to update to HikaShop 2.6.0 for that to work.
Please Log in or Create an account to join the conversation.
- ler@singmuiheng.com
-
Topic Author
- Offline
Less
More
- Posts: 575
- Thank you received: 11
11 years 2 weeks ago #216778
by ler@singmuiheng.com
Replied by ler@singmuiheng.com on topic Delivery charges on public holiday and deliver tim
Hi nicolas
What about the currency exchange rate can the additional take care of this, or we have to do it by other function?
What about the currency exchange rate can the additional take care of this, or we have to do it by other function?
Please Log in or Create an account to join the conversation.
11 years 2 weeks ago #216821
by nicolas
Replied by nicolas on topic Delivery charges on public holiday and deliver tim
Hi,
You're supposed to enter the additional fees in the same currency as the current currency that you can get with echo hikashop_getCurrency();
If you want to convert a price, you can do like that:
$currencyClass = hikashop_get('class.currency');
echo $currencyClass->convertUniquePrice($price, $srcCurrency_id, $dstCurrency_id);
You're supposed to enter the additional fees in the same currency as the current currency that you can get with echo hikashop_getCurrency();
If you want to convert a price, you can do like that:
$currencyClass = hikashop_get('class.currency');
echo $currencyClass->convertUniquePrice($price, $srcCurrency_id, $dstCurrency_id);
Please Log in or Create an account to join the conversation.
- ler@singmuiheng.com
-
Topic Author
- Offline
Less
More
- Posts: 575
- Thank you received: 11
11 years 1 week ago - 11 years 1 week ago #217212
by ler@singmuiheng.com
Replied by ler@singmuiheng.com on topic Delivery charges on public holiday and deliver tim
Hi
We are pleased that the small plugin are now ready and we would like to share with alls
There are two version,
6 options version and 2 options version and can be use together
global_cart_fee2x_deliveryday_choose - custom field "deliveryday_choose" required but you can define your own options, prices, taxes, currency
global_cart_fees6x_spec_time - custom field "spec_time" required but you can define your own options, prices, taxes, currency
We are pleased that the small plugin are now ready and we would like to share with alls
There are two version,
6 options version and 2 options version and can be use together
global_cart_fee2x_deliveryday_choose - custom field "deliveryday_choose" required but you can define your own options, prices, taxes, currency
global_cart_fees6x_spec_time - custom field "spec_time" required but you can define your own options, prices, taxes, currency
This attachment is hidden for guests.
Please log in or register to see it.
Please log in or register to see it.
This attachment is hidden for guests.
Please log in or register to see it.
Please log in or register to see it.
Last edit: 11 years 1 week ago by ler@singmuiheng.com.
The following user(s) said Thank You: nicolas
Please Log in or Create an account to join the conversation.
Time to create page: 0.342 seconds