Magento2 – terms checkbox missing in checkout

Set it from admin panel.

Click on Stores -> Setting -> Terms and conditions

Click on your Terms item from grid,

In Terms and condition page, Choose Manually from Applied dropdown section.

Magento 2.x – Required parameter ‘theme_dir’ was not passed (SOLVED)

To solve the issue, you should check in your project design folder (app/design/frontend), and find which difference you have with your database settings.

To get the database installed themes you should do:

select * from theme;

add the corresponding missing directories, or remove them from the theme database table.

Clean cache, and the error should be solved.

Add Guest Order to a Customer Account in Magento

To get the customer_id simply go to Customers > Manage Customers in the Magento admin.

Log in to the MySQL and execute the following queries:

UPDATE sales_flat_order 
 SET customer_id = (YOUR-CUSTOMER-ID), customer_is_guest=0 
 WHERE entity_id = YOUR-ORDER-ID AND customer_id IS NULL
UPDATE sales_flat_order_grid 
 SET customer_id = YOUR-CUSTOMER-ID
 WHERE entity_id = YOUR-ORDER-ID AND customer_id IS NULL

Magento: Removing Billing Agreements, Recurring Profiles & My Applications links

Magento: Removing Billing Agreements, Recurring Profiles & My Applications links from customer account.


Step 1: Go to ( yourPackage/YourTemplate/customer/account/navigation.phtml )

Step 2: Replace the below line

<?php $count = count($links); ?>


<?php $_count = count($_links); /* Add or Remove Account Left Navigation Links Here -*/
unset($_links['account']); /* Account Info */
unset($_links['account_edit']); /* Account Info */
unset($_links['tags']); /* My Tags */
unset($_links['reviews']);  /* Reviews */
unset($_links['wishlist']); /* Wishlist */
unset($_links['newsletter']); /* Newsletter */
unset($_links['orders']); /* My Orders */
unset($_links['address_book']); /* Address */
unset($_links['OAuth Customer Tokens']); /* My Applications */
unset($_links['downloadable_products']); /* My Downloadable Products */
unset($_links['recurring_profiles']); /* Recurring Profiles */
unset($_links['billing_agreements']); /* Billing Agreements */


Available qyt on the cart page in Magento 1

For the available qyt on the cart page use below code;

	   	<!-- start available qty to product in app\design\frontend\ultimo\colorfabb\template\checkout\cart\item\default.phtml-->
        < ?php

		$productId = $_item->getProductId();
		$product = Mage::getModel('catalog/product')->load($productId);
		if($product->getTypeId() == "configurable"){
			$sku = $_item->getSku();
			$simpProdId = Mage::getModel('catalog/product')->loadByAttribute('sku',$sku)->getId();
			$product = Mage::getModel('catalog/product')->load($simpProdId);

		$quantity = Mage::getModel('cataloginventory/stock_item')->loadByProduct($product)->getQty();
		<span style="font-weight: bold;color:#ff0000;">Available qty:< ?php echo (int) $quantity;?></span>
		<!-- einde available qty to product -->

Upgrade Magento 1 Via SSH

Upgrading Magento via SSH is usually much simpler than via the magento downloader. To upgrade follow these simple steps.

1. First backup. Download a copy of your database, and backup your files. You can make a zip of them.

2. Set the permissions for mage:
chmod +x mage

3. Run mage-setup and sync:
./mage mage-setup .
./mage sync

4. Upgrade Magento:
./mage upgrade-all --force

If that doesn’t work, try:
./mage install Mage_All_Latest --force

5. It’s always a good idea to run the indexer and clear the cache:
php shell/indexer.php reindexall
rm -rf downloader/.cache/ var/cache/

You’re all done (as long as there were no errors.



/mage mage-setup .

I receive:

Running initial setup…




channel-add: Channel ‘community’ already exist!


in the magento directory :

./mage channel-delete community

./mage mage-setup

Then add the extension again via magento connect


Go to “downloader” folder and delete the file “cache.cfg”. Then go back to Magento Connect and retry

Disable paypal logo from sidebar in Magento

System > Configuration > Payment Methods

> Paypal All in One Payments Solutions
> Paypal Payments Advanced (Includes Express Checkout)
> Basic Settings – Paypal Payments Advanced
> Frontend Expereince settings
> Paypal Product Logo

Oscommerce – 1064 – You have an error in your SQL syntax;

Client of mine had an error in an old version of Oscommerce with the featured product.

Featured Products
1064 – You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ‘-20, 20’ at line 1

select p.products_id, pd.products_name, s.featured_id, s.featured_date_added, s.featured_last_modified, s.expires_date, s.date_status_change, s.status from products p, featured s, products_description pd where p.products_id = pd.products_id and pd.language_id = ‘4’ and p.products_id = s.products_id order by pd.products_name limit -20, 20



Line 67 in catalog/includes/classes/split_page_results.php must be changed from:

$this->sql_query .= " limit " . $offset . ", " . $this->number_of_rows_per_page;


$this->sql_query .= " limit " . max($offset, 0) . ", " . $this->number_of_rows_per_page;

Line 38 in catalog/admin/includes/classes/split_page_results.php must be changed from:

$sql_query .= " limit " . $offset . ", " . $max_rows_per_page;


$sql_query .= " limit " . max($offset, 0) . ", " . $max_rows_per_page;

Magento Import Products

  • Go to Magento Admin > Catalog > Manage Categories
  • Add your Product categories here but do note your category ids, you can make a list of your category ids in a notepad file.
  • There might be a possibility that you need to define extra attributes for your products so for that go to Catalog >Attributes >Manage Attributes and click Add new Attribute. You can also save your Attributes sets based on the attributes you have defined.
  • Now go to Magento Admin > Catalog > Manage Products
  • Add four to five products manually.
  • Now go to Magento Admin > System > Import/Export > Profiles
  • Click Export all products.
  • In Data Transfer choose Local/Remote Server (If you choose remote ftp, then you will have to provide the ftp information)
  • Any select Local Server (though its upto you) and click Save Profile.
  • Now click export all products again and then click Run Profile on your left.
  • This will save a csv file of your manually added products on to your local/remote folder
  • Download that csv file on to your computer using any ftp client (filezilla).
  • You will have a csv file having columns of all the product attributes such as store, websites, attribute_set, type, sku, category_ids, has_options, name,meta_title etc
  • Populate these columns with your products and add the category ids that you had already saved in a notepad file in category_ids column to properly assign the products to their respective categories.
  • When you are done, go again to Magento Admin > System > Import/Export > Profiles and click Import all products this time.
  • Click Upload file, browse for that csv file and then click Save Profile. (Or you can upload the csv file via ftp client such as filezilla to var/import folder)
  • Now again click Import all products, click Run Profile, Select the csv file that you have uploaded from the drop down and then click Run Profile in popup.
  • Products will start importing into your Magento Store

Problems with the import/export feature ?

I got the import/export business working by:

1. Using the default Export All Products profile and making sure to set the file name ending to .XML not .XLS
2. Using Excel to edit the file.
3. Using the default Import All Products profile to import.