Facing cache issue on CMS page - magento

I'm facing one issue on magento2.
I have created one CMS page and want to display current CART items on cms page.
So i have created on test.phtml file and call from CMS page.
{{block class="Magento\Framework\View\Element\Template" cacheable="false" template="Magento_Theme::test.phtml"}}
Whatever i have written in test.phtml file will only display if i'll clean my cache. It's not display directly if i'll update anything.
I have already written cacheable="false" but it's not working.
Can anyone please help.
Thanks in advance.
Thanks,

Related

Display template in front-end

I followed the tutorial of Inchoo for Magento
How to add custom contact form with email notification I added the files as mentioned now i need to know how to display it in front-end.
Tutorial link: inchoo.net/magento/magento-email/magento-custom-email-contact-form-with-notification-system/
Regards,
Add this in your cms page
{{block type="core/template" name="simple_contact_form" form_action="/inchoo-simplecontact/index/sendemail" template="inchoo/simple_contact.phtml"}}
Check app\code\local\Inchoo\SimpleContact\controllers\IndexController.php
there is sendemailAction() and in it at last $this->_redirect('inchoo-simplecontact/'); this will redirect. So may you want to change redirect it's here.

Static block not showing up in CMS page

I just started working on magento/admin. I am trying to show my static block in one of my CMS pages, but it is not working. I tried to find out answer in google and stack exchange but no luck! Can anyone please help.Thanks.
Below are details:
This is my static block
This is my CMS page: I am able to see the text "Yes!" though.
Final output: That blue box is my CSS. (jfyi).
If you use the latest Magento version 1.9.2.2 that includes the latest patches, then you need to add first the block to Magento white list in teh backend: System->Permissions->Block.
See this article: http://www.dudesquare.nl/blog/2015/10/31/static-block-shortcodes-not-working-1-9-2-2/
Please set different identifier in static block than CMS page. I think CMS page and block identifier same so may be block not display on CMS page.
Also select all store views in static block may be your store is wrong.
And finally remove all cache and refresh all index.
Please check following:
Whether you had editor enabled, while calling static block. If yes, please click on Show/Hide Editor button and check what code is there in text area while editor mode off.
If above does not work, then go to System >> Configuration >> Advanced (Developer) and under Log Settings, Enable Logs. Then refresh cms page in frontend.
I hope this will help you resolve your issue. Please let me know if you find any problem.
Try to add static blocks through Layout Update XML in CMS Pages use something like this code. Add this code in your CMS page design tab.
<reference name="content">
<block type="cms/block" name="block.name">
<action method="setBlockId">
<block_id>block_id</block_id>
</action>
</block>
</reference>
Solution:
Step 1)Go to admin.
Step 2)Open Top menu System->Permissions->Blocks.
Step 3)click "Add New Block".
write your "Block Name" and Is Allowed "Yes".
Note: Block Name is type of your block for example "cms/block"
after Save Block.
Step 4)Clear cache and refresh front page. Now Block is showing.
Done.

Get Top/Best Rated Product in Magento

I want to best rated product on a magento homepage. I have product reviewing module configured on my site.
i have tried following this http://www.odino.org/84/retrieve-top-rated-products-in-magento
but am unable to get it working.
My homepage is formed my calling one block from the cms home page {{block type="page/html" template="page/html/home.phtml"}}
and i have tried putting the php code in home.phtml
The link i have posted asks to create a helper, but i don't know how to go about that, so what i did was wrote a normal function within the page and called it.
Any help would be seriously appreciated :)
Thanks
Look at this module from Inchoo, explained with all the required changes you need to make with screenshots. Hopefully this will be helpful
http://inchoo.net/ecommerce/magento/bestseller-products-in-magento/

How can I add custom fields in cms edit page (Admin Panel)?

I am facing an issue in Magento. I want to add some custom fields to Magento Admin Panel CMS Edit Page. I got a page while searching where it describes adding a custom field in CMS page: http://blog.flexishore.com/2011/08/add-custom-field-to-cms-page/ .
I have followed every step in this, but I am still getting an error Call to undefined function getLoad().
Can anyone here explain me how to add custom fields in CMS page?
You can try this article (http://www.atwix.com/magento/adding-custom-attribute-to-a-cms-page/) as well, it's more simple, maybe it will be helpful for you.
Also don't forget about cache, I recommend you disable it when you are testing your own modules.

Magento Problem

I am running a store on Magento. For some reason the "Recently Viewed", "Related Items" and "Featured Items" blocks have all disappeared from my site. They where definitely there yesterday so I'm not sure what's happened to them.
Featured Products is an extension I use and show on the home page using:
{{block type="featuredproducts/listing" template="inchoo/block_featured_products_main.phtml"}}
Does anyone have any idea what the problem could be?
Reindexing my products fixed this.
system > index management
Probably some Blocks that don't render. Check your /var/log/errors.log for clues (1) and remove the module if is giving you problems(2).
This one here is trying to load the Featuredproducts_Block_Listing class. Check if is there and if is not misspelled.
Have you added any custom module to magento related to products like feature products or products on sale, if yes then just make it false from XML file /app/etc/modules/module.xml
and then refresh or delete the cache and try again with front end.
If this will not work then just simply delete all cache, session and logs. and refreh the web page it will work.
Thanks
Magento Development

Resources