Author: james

Magento2 sorting collection order

Collections in Magento2 can be a real pain. Was having problems with sorting a category getProductCollection collection into position order! The products were just displaying in random order(or rather ID number order). $categoryId=891; $category = $this->_categoryFactory->create(); $category->load($categoryId); $products = $category->getProductCollection();$products->addAttributeToSelect(‘*’);$products->setOrder(“cat_index_position”,’ASC’);

read more

How to test Magento2 REST API with Postman

This assumes you’ve created a new Integration in Magento 2 by going to M2 Dashboard -> System -> Integrations. Create a new one, give it Resource Access to ALL and save. Then Authorise it, then it’ll create new consumer_key,consumer_secret,access_token,token_secret values

read more

Adding a sub-domain Website to Siteground

I found problems adding an already used domain as a website eg. if startnet.co.uk was already on Siteground it didn’t like me adding test.startnet.co.uk when creating a website. So found this solution: Login to Siteground. Add a new Website Pick

read more

Save Streetview image on Google Maps

Wanted to say a Google Maps Streetview image – without all the buttons and tags. Use the code below, then use Snipping Tool to save the image. Note: the only problem are the new hover icons, I couldn’t get the

read more