Magento 2 Dynamic Sale Catagory
Table of Contents
- Installation via app/code: Upload the content of the module to your root folder. This will not overwrite the existing Magento folder or files, only the new contents will be added. After the successful upload of the package, run below commands on Magento 2 root directory.
php bin/magento setup:upgrade
php bin/magento setup:di:compile
php bin/magento setup:static-content:deploy
- Installation via Composer: Please follow the guide provided in the below link to complete the installation via composer.
Go to Admin > Stores > Configuration > Scommerce Configuration > Dynamic Sale Category
- Enabled – Select “Yes” or “No” to enable or disable the module.
- License Key – Please add the license for the extension which is provided in the order confirmation email. Please note license keys are site URL specific. If you require license keys for dev/staging sites then please email us at [email protected]
- Sale Category – Choose the sale category where all the sale products will appear. All products in the current category would be removed, If any assigned. This category will only be populated with products set up for offer through special prices.
- Exclude Categories – Exclude some categories for pulling sale products from them.
- Hide Sale Category with no Product – Set to yes if you want to hide the sale category when no products are in offer.
- Display Sale ends date on the Product Page – Set to yes if you want to show the sales end date on the product page.
- Sale ends text on the Product Page – Add text for sale ends date on the product page.
- Date Format on the Product Page – Select the date format for sale end date to be displayed on the product page.
- Display Sale Ends text on the category Page – Set to yes if you want to show sales ends date in the product listing.
- Sale ends text on the Category Page – Add text for sale ends date in listing. Please include space if needed.
- Date Format on the Category Page – Select the date format for sale end date displayed on category page.
- Cron Schedule – This setting will be used to send the email through the cron.
- Duplicate Urls Fix - Use this if command shows error "URL key for specified store already exists.". Note: it's not going to fix URLs duplicated key issue. It will just use another algorithm of assigning. The best option is to to fix duplicated URLs. Put "Yes" if you know what you are doing
As soon as any product is set with valid special product it automatically gets assigns to category set up for sale/offers in configurations. You can set special price from Admin > Catalog > Products > Select Product > Advanced Pricing > Set "Special Price" . There is a cron job which runs midnight and checks for any product set up under offer.
- Products Assigned to Sale Category in the Back-end - You can see the Sale Products in the back-end under "Sale/Offers" categories, from Admin > Catalog > Categories > Select Category "Offers" > Click on "Products in category" .
Run the below refresh command to show the products under sale category.
- Sale Products on the Category Page - The products with special price will be shown on the category page under the category you have selected from Admin > Stores > Configuration > Scommerce Configuration > Dynamic Sale Category - "Sale" or "Offer", along with the sale ends date.