Hi @GauravMehta04, Thank you for your answer.
I'll share the entire task:
develop an extension that will show a promo bar in chosen pages and can have either 1 or two bars. see asos for reference -
http://screencast.com/t/CVVBteS4a . we want to be able to display different bars in different pages (i.e bar 1 on PDP -product detail page and bar 2 on PLP-product list page)
requirements:
1. for each bar, we should be able to set the following css values in admin:
2. on desktop: we should be able to set either two or one promo bar in desktop. when 2 is set - they should spread 50-50 % , when one is set - 100% of pages width. on mobile: always show one bar, when two are set on desktop - always show right one on mobile
* mobile should always show the right one if two are configured , and show the one - if one is configured.
3. we should be able to present different bars in different categories , so each bar should have a list that allow multiple selection of pages - cart, home page, a list of all cms pages that we have in admin ,a list of all categories we have in admin, PDP . (when PDP is checked - bar should appear on all PDP's)
4. if two bars are assigned to the same page, and they are not 50-50 - show the one with the most recent update date.
* refers to a case where two right bars were configured to the same page. its a requirement meant to deal with a miss configuration situation. so if someone did a mistake and set two right instead of right and left - your code should handle this by choosing the one with the most recent update date
5. each bar have an update date
So I thought of implementing it by adding a block to the catalog price rule form (i.e in 'Action' tab) and set the multi-select box for pages this promotion should be in and if it's right or left.
The second thing I need to implement is the 1 or 2 promotion bar for each page that was configured in admin.
I know it's rought but ill really appriciate your help