Opencart – restrict payment and shipping methods based on products weight

Restrict payment method (for example Cash on Delivery) if product weight is above 1 kg (or any other default unit) IN: /catalog/model/payment/cod.php AFTER: public function getMethod($address, $total) { ADD: if ($this->cart->getWeight() > 1) return; Restrict shipping method, for example, disable Weight Based Shipping if weight is less than 1 kg: IN: catalog/model/shipping/weight.php BEFORE: if ($status) { ADD: if ($this->cart->getWeight() < 1) {$status = false;} […]

Read More»

Insert additional code in between wordpress posts

Your code will be loaded before the second post. Open index.php file. 1. add this code before “if have_posts()”: <? php $postNo = 1; ?> 2. add this code after “while ( have_posts() ) : the_post(); ?>”: <? php if ($postNo === 2) : ?> /* put anything here*/ <? php endif; $postNo++; ?> Full […]

Read More»

Fancy rounded arrow

Read More»

List in style

Put some style on your html list. The numbers in list don’t have to be decimals. They can be anything that list-style-type can be. For example: disc (• • •) circle (○ ○ ○) square (▪ ▪ ▪) decimal (1 2 3) decimal-leading-zero (01, 02, 03) lower-roman (i ii iii) upper-roman (I II III) lower-greek […]

Read More»

How to restore cached page from Chrome cache?

1. Open Chrome and go to chrome://cache/ 2. Click on the file you want to restore. It should open a page with encrypted cached version of the page – numbers and letters. 3. Open JavaScript console (View -> Developer -> JavaScript console) 4. Copy and paste the code below in JS console and press enter on keyboard: 5. […]

Read More»
shared on wplocker.com