Posts

Showing posts from August, 2015

Add discount programmatically in Opencart

Image
To add the discount in opencart programmatically follow the following steps:

1. Open <projectFolder>/catalog/model/total/coupon.php
2. Add the code in the getTotal() function

$discount_total=0;
if($total>=0 && $total<=500){
  $discount_total=$total*0.1;
}else if($total>500 && $total<=1000){
  $discount_total=$total*0.2;
}else if($total>1000 && $total<=10000){
  $discount_total=$total*0.3;
}
*/
$total_data[] = array(
'code'       => 'discount',
'title'      => sprintf("My Special Discount"),
'value'      => -$discount_total,
'sort_order' => 4
);

3. Now add the products in the cart
4. Goto Cart page check your order info (See the sample screenshot)



Magento OOTB modules

Marketing / promotional / conversion toolsSearch engine optimizationSite managementCatalog managementCatalog browsingProduct browsingInternational supportAnalytic s and reportingMobile commerce (Mobile HTML5, Responsive design, Native device applications)Customer accountsOrder managementCheckout, payment and ShippingCustomer Service

Create views in wordpress

We can separate the posts into different views

CREATE VIEW dictionary AS
SELECT ID, post_title as term, post_content as content, post_excerpt, post_status, LEFT(post_title , 1) as first_letter
FROM wp_posts
WHERE post_type like 'dictionary' and post_status like 'publish';