Enable/Disable Payment methods based on condition in Magento 1.9

There may be some condition where we need to Enable/disable any specific payment method based on condition.

For example a gift card product, virtual product or any other condition,

We are going to create a simple module say .

Create following files:

app/etc/modules/Pawan_FilterPaymentMethod.xml

app/code/local/Pawan/FilterPaymentMethod/etc/config.xml

app/code/local/Pawan/FilterPaymentMethod/Model/Observer.php

After that you need to flush cache.

You can download module:
Pawan_FilterPaymentMethod_0.0.1

How to show Coupon code on checkout page Magento 1.9.x

Many times we need to show coupon code form on checkout page in progress section.This can be achieved by Simple module. first we need to add form on checkout page in following file:

app/design/frontend/{package}/{theme}/template/checkout/onepage/progress.phtml

Above code will Show Coupon form but for Showing success/error message, We need a proper override of couponPostAction action of CartController. We are going to create a small module.

create: app/etc/modules/Pawan_Coupon.xml

app/code/local/Pawan/Coupon/etc/config.xml

app/code/local/Pawan/Coupon/controllers/CartController.php

Final result will be:

Prevent from appending SKUs of product with custom option in Magento 2

If a product having custom option, its SKU is created on the fly.
If you look at file.

MagentoRoot\vendor\magento\module-catalog\Model\Product\Type\AbstractType.php

You will find a function getOptionSku, which is responsible for creating SKU.

If you want to remove custom option SKU to main product’s SKU, You can change to

**$sku**

From

**$sku .= $skuDelimiter . $optionSku;**

Where

$sku = SKU of product
$skuDelimiter = –
$optionSku = SKU of custom option of product

You can change as per your requirement.

**Note:** Never edit core files, you need a proper Model overriding. For test purpose you can check by putting die below this sku generation code and add a product from front.

How to move product description to appear right after the short description in magento 2

For remove Description Tab and adding description below short description use below code at :

app/design/frontend/Namespace/Theme/Magento_Catalog/layout/catalog_product_view.xml

 

Before Changes:

After Changes: