How to disable Cash on Delivery for Downloadable products on Opencart 2.1.0.1 - opencart2.x

How to disable Cash on Delivery for Downloadable products on Opencart 2.1.0.1?
I want just Bank transfer and Credit card pay options for Downloadable products.

Here is the simple solution. Just try this one. Change file catalog/model/payment/cod.php
Replace if ($status) { with if ($status && $this->cart->hasShipping()) { and it will work.

Related

How display price in ml in Stripe API Checkout?

With Stripe API Checkout, does anyone know how to change what I underlined ?
I need to display a price in ml. Example: I must write /100 ml and not /piece
This value isn't customizable. I think the best way to handle this is to add the size to the product name, "Le Baume (100ml)".

Oracle NetSuite: How to get internal/external id from currency?

I am a newbie of NetSuite developer.
We have some Currencies HKD/CAD/EUR/USD/CNY/SGD/GBP/AUD in accounting, and HKD is the base currency.
Now I want to add USD currency to all customer by importing csv, but don't know how to get information of USD currency:
RecordRef ccy = new RecordRef();
ccy.setType(RecordType.CURRENCY);
ccy.setInternalId("?"); // Don't know how to get internal id of USD currency
ccy.setExternalId("?"); // Don't know how to get internal id of USD currency
CustomerCurrency customerCcy = new CustomerCurrency();
customerCcy.setCurrency(ccy);
CustomerCurrencyList customerCcyList = new CustomerCurrencyList();
customerCcyList.getCurrency().add(customerCcy);
customer.setCurrencyList(customerCcyList);
updateCustomer(customer);
Please give some advise to me, thank you very much.
In you netsuite preferences, you can turn on the option for "Show internal ids." Once you have that set, the currency view should show you your internal ids. Alternatively, you can right click and go to developer tools in chrome or firefox and look at the internal ids on the elements.

Find credit card by type and expiration date

According to this "Account Updater only works with Visa and Mastercard"
So I want to find customers whose cards are going to expire in the next month and are from a different type than Visa or Mastercard.
In the docs I see I can filter by expiration date, but nothing about cardType (it mentions cardholderName)
var stream = gateway.customer.search(function (search) {
search.creditCardExpirationDate().is("12/13");
});
Is there a way I can filter this in the api request or should I need to get all results and filter out Visa and Mastercard customers?
Thanks.
Full disclosure: I work at Braintree. If you have any further questions, feel free to contact support.
Both you and #michelem are correct: the current api doesn't expose a method for filtering customers based on whether they contain a specific type of card. Your approach of filtering the results based on the Payment method is the best approach.

Opencart how to show free shipping if order is above X amount otherwise X delivery charges?

I would like to if order is above x amount then free shipping otherwise need to charge x amount.
In Free Shipping i already set X amount.
In Flat Rate i set X amount.
But in frontend if order is above x amount then it display both Free Shipping & Flat Rate.
What i need if order if above X amount then it display only free shipping otherwise flat rate.
Here is a simple idea, return Flat Rate only if Subtotal amount is less then Free shipping
// catalog/model/shipping/flat.php
replace
return $method_data;
with
if ($this->cart->getSubTotal() < $this->config->get('free_total')) {
return $method_data;
}
If you use OC 3.0.2 version, you should...
in file: //catalog/model/extension/shipping/flat.php
find:
return $method_data;
and replace with:
if ($this->cart->getSubTotal() < $this->config->get('shipping_free_total')) {
return $method_data;
} elseif (!$this->config->get('shipping_free_total')) {
return $method_data;
}
This modification will disable flat shipping method when cart total will be reached which is set in free shipping method. So two shipping methods must be enabled. Flat rate shipping method and Free shipping method.
Flat shipping will work even if you disable Free shipping.
After you make this changes refresh modifications and clear cache in admin dashboard.
You gotta enable both the shipping extensions in order to function without error. Please enable both Free Shipping and Flat Rate modules in admin panel.
I did it
Go to these steps
Go to the Extensions
Select Extension type -- Shipping
Install Flat Rate and Enable it
Give your FLAT rate Cost (The cost that you want to charge for your shipping)
Again Install Free Shipping and Enable it
You will find Total Field (The total amount that you want to keep)
Save it
Go to your project folder/catalog/model/extension/shipping/flat.php
You will get return $method_data;
Replace with this code :
if ($this->cart->getSubTotal() < $this->config->get('shipping_free_total'))
{
return $method_data;
}
Check this getSubTotal() function is available or not in your Project folder
system/library/cart/cart.php
It will be available
12. Again check this shipping_free_total field name by
Going back again to the Free shipping extension and in Total field
Do inspect and get the Field Name
I am using 3.x so my Total field name is shipping_free_total, i am not sure but it may be vary this field name according to the opencart version.
Check it. You are done. Thanks.
This extension "Display Customized Message" can help you show it easily within seconds. Link below
https://www.opencart.com/index.php?route=marketplace/extension/info&extension_id=22785
So if you want to show the amount left to qualify for free shipping. This is one of the best extensions for that. As it works automatically.
Also once yo

magento Enable 'free shipping' only when certain discount code used

we have a discount code set-up for friends. When they use it they get 10% off. In reality many friends logically live nearby and hence ask me: why cant I also pickup the items this weekend? We do however in general not support pickup.
What we would like is the following. When the "friend discount code" is used - only known to friends - the option 'free shipping/pickup' should become available. Only in this case. (ad. We dont want to offer free shipping persé. Some friends do live far away and get it per post, but we want them to have the option to choose)
Any tips or ideas on how this could be accomplished?
[UPDATE]
I am thinking 2 solutions.
Create a second discount code that enables free shipping (and you also only tell your friends to use when they want to pickup)
Little more difficult - but does what we want: Edit files in /public_html/app/design/frontend/base/default/template/checkout/onepage/shipping_method
(are these the right ones?)
a. in loop addding shipping methods add free shipping
b. but only if variable get couponcode is value XYZ
Create a customer group for special customers
Assign those special customers to this group
Create a shopping cart price rules for %10 discount
Select the customer group that we created above from "customer groups" section
Apply necessary settings for the rule ( coupon code etc.. )
also, take the following references :
What are Shopping Cart Price Rules and how do I use them?
How to Setup Simple Customer Specific Discount Pricing
The easiest way is to
create a website on your store for friends only.
Forbid guest buy there.
Forbid open registration.
(you can forbid browsing without login)
Configure settings for website, you need.

Resources