sitewards / B2BProfessional

The Sitewards B2B Extension extends your webshop with some essential functions to realize a B2B Store
http://www.magentocommerce.com/magento-connect/sitewards-b2bprofessional.html
69 stars 39 forks source link

Applying To Custom Base Level Templates #1

Closed lukebranch closed 11 years ago

lukebranch commented 11 years ago

Hi, this is an extremely useful addition to the Magento Community, thank you.

I would like to know how I would go about applying this to custom templates, as I need to use conditional modifiers to remove a number of features from the header of a custom template such as shopping cart, sign up, my account, checkout, login, as well as a number of items from the product level page and catalog level page.

My aim is to have a fully functional product catalog for the average visitor to browse, while ultimately utilizing the Magento backend for wholesaler's to login and place orders.

It seems that there will be a few customizations needed on my custom theme in order to get it to work, if you could provide any insight into how this might be done with your extension it would be much appreciated.

dmanners commented 11 years ago

Hi,

Thank you for the feedback, it is great to hear that people find this a useful extension.

Most of the removal of items is done in Sitewards\B2BProfessional\Model\Observer.php function onCoreBlockAbstractToHtmlAfter. Here we do a lot of block based checks for Price, Totals and Checkout blocks.

If you want to check access by a product, user or category basis then call the function checkActive from Sitewards_B2BProfessional_Helper_Data. This will take a product id as an optional parameter.

There is also another function in the helper hasValidCart which will check if the cart is valid. This is used to remove prices or the side bar from the default template.

If you are looking to replace just a small section of a block then look at how the onCoreBlockAbstractToHtmlAfter deals with the block Mage_Checkout_Block_Cart_Sidebar. Here we have defined, via the config xml, the html tag (including identifier) that we want to replace.

The standard "Checkout" link in the header is removed by a block rewrite of Mage_Checkout_Block_Links

Hope this helps with your request. If you have any more questions then feel free to ask away.