Pushing multiple magento products / static blocks live simulatenously - php

I have a customer who has a drop-ship type of Magento site, new products go live every month - I need to figure out a way to make all the products ideally go live at once, as well as the changes to all the pages.
Many of the pages that display a list of category products reference static blocks, whose content also needs to change..
an example:
{{block type="cms/block" block_id="category-art-october-2013"}}
{{block type="catalog/product_list" category_id="41" template="catalog/product/list.phtml"}}
{{block type="cms/block" block_id="coming-soon-art-october-2013"}}
Is it the best way / possible to have some kind of variable in the static block, so that I can change some sort of date/identifier and have it load in the correct month of products?

instead of using {{block type="cms/block" block_id="category-art-october-2013"}} {{block type="catalog/product_list" category_id="41" template="catalog/product/list.phtml"}} {{block type="cms/block" block_id="coming-soon-art-october-2013"}}
you can try doing this via the xml layout updates, which would allow you to use "Custom Designs" with "from" and "to" dates.
under Layout Update XML from your cms pages, you can try something like this
<reference name="content">
<block type="cms/block" name="art-october">
<action method="setBlockId"><block_id>category-art-october-2013</block_id></action>
</block>
<block type="catalog/product_list" name="list_category" template="catalog/product/list.phtml">
<action name="setCategoryId">41</action>
</block>
<block type="cms/block" name="art-comming-soon">
<action method="setBlockId"><block_id>coming-soon-art-october-2013</block_id></action>
</block>
</reference>
and the prepare the configuration for the next month under "Custom Design" and adjust the xml to you needs.
hope that helps

Related

Magento Automatic sales category not showing products proberly

I am trying to do an automatic sales category for my magento webshop. - I have followed this tutorial: https://www.creativemgroup.com/creative-media-web-services/magento-blog/68-create-a-magento-on-sale-category-the-right-way
The php script itself works as intended, as it shows the products with specialprice/on sale on sales category.
Problem: The product does not show the right way, the products needs to be shown as they are shown on my frontpage (With flags, shortdescription and so on)
see frontpage: Link Deleted
see salescategory: Link Deleted
I am almost sure, the problem is with the "Custom Design" xml for my category:
<reference name="content">
<remove name="product_list"/>
<block type="catalog/product_sale" name="product_sale" alias="sale" template="catalog/product/list.phtml">
<block type="catalog/product_list_toolbar" name="product_list_toolbar" template="catalog/product/list/toolbar.phtml">
<block type="page/html_pager" name="product_list_toolbar_pager"/>
</block>
<action method="setLimit"><limit>32</limit></action>
<action method="setColumnCount"><columns>3</columns></action>
<action method="setToolbarBlockName"><name>product_list_toolbar</name></action>
<action method="addPriceBlockType">
<type>bundle</type>
<block>bundle/catalog_product_price</block>
<template>bundle/catalog/product/price.phtml</template>
</action>
</block>
</reference>
<reference name="product_list_toolbar">
<action method="setDefaultGridPerPage">
<limit>32</limit>
</action>
</reference>
How do i get the right "Product" design for my sales category? I am not skilled in neither xml nor magento blocks
Hoping for a helping hand here.
As i kept searching for solutions to this problem, i came across the fact that.. maybe the php file did not bring my "custom" product-attributes to the array, from wich the product is build.
I added these attributes to the php file, and boom - everything worked like a charm. (Hopefully this will help others in my situation)

Magento - Category Custom Layout Update

I want to add a custom CMS Block into my category per category. So I created a Custom CMS Block:
Title: TestBlock
Identifier: testblock
Then I enter into my category and under Custom Design Tab - in the Custom Layout Update textarea, I add the following
<reference name="left">
<block type="cms/block" name="TestBlock" after="catalog.compare.sidebar">
<action method="setBlockId"><block_id>testblock</block_id></action>
</block>
</reference>
This adds the content of my custom CMS Block in the sidebar, but the positioning is wrong. Instead of adding it at the bottom of the sidebar (last block is the Compare Products), it ends up at the top. Any ideas how to position it properly? I'm using Magento CE 1.9.0.1
Try not using "after" in your block, it may work.
You may try as per following.
<reference name="left">
<block type="cms/block" name="TestBlock" after="-">
<action method="setBlockId"><block_id>testblock</block_id></action>
</block>
</reference>

How can I add banner to product page? (magento)

I have my homepage redirected to a product page, but I still want my banners from the home page to show up.
Anyone have any clue how I can add banners to my product page ? Pretty new to Magento... Certainly not as easy as Joomla.
There are handles in Magento who decide what block to show when specific controller is called.
Take a look at this file
/magento/app/design/frontend/base/default/layout/catalog.xml and find following lines
<catalog_product_view translate="label">
<label>Catalog Product View (Any)</label>
<!-- Mage_Catalog -->
<reference name="root">
<action method="setTemplate">
<template>page/2columns-right.phtml</template>
</action>
</reference>
<reference name="content">
<block type="catalog/product_view" name="product.info" template="catalog/product/view.phtml">
<!-- Some more code -->
</block>
</reference>
<!-- Some more code -->
</catalog_product_view>
catalog_product_view is the handle you may want to use for displaying the banner on product page.
Pick that handle and write the block specific code.
If you want to use an extension to simplify your task here is the one.
You can call banner code on products page. Or if you want to go with simple technique, use iframe

Remove left hand column on product listings page in Magento

How do you remove the left hand column on product listings page in Magento?
I've looked in the local.xml file but I'm not sure which code I should edit.
You can change template of product listing in admin:
- Catalog->Manage Categories->Your category - tab Custom Design - field - Page Layout
OR
in your design layout xml (local.xml or something else) :
<catalog_category_layered>
<reference name="root">
<action method="unsetChild"><name>left</name></action>
</reference>
</catalog_category_layered>
OR
<catalog_category_default>
<reference name="root">
<action method="unsetChild"><name>left</name></action>
</reference>
</catalog_category_default>
also you can set anpother template in xml:
<catalog_category_layered>
<reference name="root">
<action method="setTemplate"><name>page/1column.phtml</name></action>
</reference>
</catalog_category_layered>
see template/page/ for templates.
Using local.xml (read 5 Useful Tricks For Your Magento local.xml)
<catalog_category_default translate="label">
<remove name="left"/>
</catalog_category_default>
Why do you need to remove the "left column" why don't you just change the product listing page to a different layout. i.e 2column-right.phtml, 1column.phtml, or 3column.phtml there is no need to physically remove the left column under 99% of most situations just change the layout.
First you need to create or update your local.xml file IF you do not have a local.xml file you can create one in
app->frontend->[Package Name]->[Theme Name]->layout->local.xml
Once this is created you can copy exactly what I have in this post into that file for a start of how to use one.
DO ALL UPDATES THROUGH A LOCAL.XML file not through catalog.xml !! This will make upgrades significantly easier later down the road. Additionally, you will be able to quickly see all changes you have made to your site in one file.
The below example will set the product listing page to 1column
<?xml version="1.0" encoding="UTF-8"?>
<layout>
<catalog_product_view translate="label">
<reference name="root">
<action method="setTemplate">
<template>page/1column.phtml</template>
<!-- Below are examples of different layouts you can use
<template>page/2columns-right.phtml</template>
<template>page/2columns-left.phtml</template>
<template>page/3columns.phtml</template> -->
</action>
</reference>
</catalog_product_view>
</layout>
Hope this helps and is a guide to some newbies out there.

Magento - Trouble getting Sidebar navigation to show on category pages

This is perplexing me somewhat.
I'm on magento 1.7.
I have a left sidebar on all pages, and I'm trying to add a vertical navigation block to this side bar, to appear on all pages. So far, through editing catalog.xml, I can get it to appear on the front page, and the individual product pages, but it disappears when I visit a category page (the one that lists all the products in a category). When I try to add this block in via the "Custom Design" option for the category in the backend, it inserts the block into the sidebar 5 times, one on top of the other.
In catalog xml, right under < !-- Mage_Catalog -->
<block type="catalog/navigation" name="catalog.leftnav" template="catalog/navigation/vert_nav.phtml" before="cart_sidebar" />
I think I've tried placing this is every place in catalog.xml that seemed to make sense, but I just can't figure out why I can't target the categories, and why the multiple blocks problem is happening.
I have also tried to add the block to page.xml, and although that works for the front page, it doesn't for the categories.
Thanks in advance
Please check if you have done as follows correctly.
On catalog.xml search Catalog Category (Non-Anchor) and locate <reference name="left">
by default it is
<reference name="left">
<block type="catalog/navigation" name="catalog.leftnav" after="currency" template="catalog/navigation/left.phtml"/>
</reference>
Change it to
<reference name="left">
<block type="catalog/navigation" name="catalog.leftnav" after="currency" template="catalog/navigation/left.phtml"/>
<block type="catalog/navigation" name="catalog.vert_nav" template="catalog/navigation/vert_nav.phtml" before="catalog.leftnav" />
</reference>
Do same for Catalog Category (Anchor)
Hope above helps.

Categories