magento-1.7

How to Clear magento cache and log table?

被刻印的时光 ゝ 提交于 2019-12-03 21:56:09
I have lot of issues fetch of cache related so I need to clear all magento cache and log in database by php script. Any help me. Create a file called cleanup.php and add the following code to it: <?php switch($_GET['clean']) { case 'log': clean_log_tables(); break; case 'var': clean_var_directory(); break; } function clean_log_tables() { $xml = simplexml_load_file('./app/etc/local.xml', NULL, LIBXML_NOCDATA); if(is_object($xml)) { $db['host'] = $xml->global->resources->default_setup->connection->host; $db['name'] = $xml->global->resources->default_setup->connection->dbname; $db['user'] = $xml-

Import Orders in Magento through CSV

倾然丶 夕夏残阳落幕 提交于 2019-12-03 21:18:36
I have used below code. It is working on simple product and single product. Creating order programmatically for all types of products. First I have added product into the cart, then I have added all parameters to order like shipment, payment method and billing and shipping method accordingly. When I add options to the product it generates blank product order. But it is not working for other product types. I used below script also, http://pragneshkaria.com/programmatically-create-order-in-magento/ Please help me to create orders programmatically. Manoj Chaurasia You have to create a module for

how to add a 3rd party library to magento?

时光总嘲笑我的痴心妄想 提交于 2019-12-03 18:57:58
问题 The library doesn't need to integrate with magento, it's mostly a wrapper that communicates with an API. I would like to be able to use this library and make these API calls from within a controller or model. Where can I put the library? How do I add them to the autoloader? 回答1: Look into /lib folder in your website root directory. From Magento Base Directories: Magento’s library folder is where non-module based Magento code lives. This include a large amount of the system code which allows

Magento CE 1.7.0.2 – Imported products do not show up in frontend

戏子无情 提交于 2019-12-03 17:21:32
I've been battling with this issue for the last week now, and am really hoping someone here might be able to help me with it. After repeatedly importing products from a CSV generated by a different (and slightly older) Magento store, using both the Import and the Dataflow/Import All Products tools, I can get them to show up in the backend , seemingly with all the data intact and with images and everything, but they simply will not show up in the frontend . It seems that the only way to make them show up in the frontend is to save them from the admin product page, which I'd rather not make the

How do I get the category ids that a product is in with respect to the store that I'm currently on

柔情痞子 提交于 2019-12-03 16:50:31
I'm on a product page and have the product object but when I try to get the category ids using: $_product->getCategoryIds(); or: $_product->getResource()->getAttribute('category_ids')->getFrontend()->getValue($_product); it gets me all the category ids and I just want the ones for the store I'm on. It's a multistore environment so hence my problem. Everything else seems ok and the category list works fine. This is my only problem. Can anyone help? Pretty similar to Alans answer, maybe a bit less looping: $rootCategory = Mage::getModel('catalog/category') ->load(Mage::app()->getStore()-

How to add custom tab in left sidebar to my custom page in admin section in magento module?

▼魔方 西西 提交于 2019-12-03 16:48:38
I am very new to Magento , just started Magento before 4 days but i am given the task to develop a Magento extension . So i am reading over the internet and creating it. Now the problem i am having is i want to add a custom left sidebar tabs just like it is under System->Configuration . I have tried a lot but no success. Please help me. Here's my config.xml <?xml version="1.0"?> <config> <!-- turn on our module, required for install support --> <modules> <Gwb_Magecrmsync> <version>0.1.0</version> </Gwb_Magecrmsync> </modules> <frontend> <routers> <magecrmsync> <use>standard</use> <args>

Magento Product Collection Select all Attributes

不问归期 提交于 2019-12-03 16:33:03
I'm trying to create a model that selects a specific product and all it's attributes. $products = Mage::getModel('catalog/product')->getCollection()->addAttributeToSelect('*'); But sadly although I have done this hundreds of times before, we're having a Magento moment... echo $products->getSelect()->__toString(); reveals that ->addAttributeToSelect is ignoring me. SELECT `e`.* FROM `catalog_product_entity` AS `e` Of course in typical Magento fashion there are no exceptions or errors of any kinds. I am calling these methods in my own Adminhtml Grid block, caching is disabled (even though I know

wamp tmp folder takes some GB of space while running magento in localhost

吃可爱长大的小学妹 提交于 2019-12-03 14:59:11
问题 wamp tmp folder takes some GB's of space while running magento in localhost , like this some files are created in Wamp/tmp folder, while i using magento cachegrind.out.1367384833 cachegrind.out.1367384834 cachegrind.out.1367384835 file contain code like this version: 1 creator: xdebug 2.2.0 cmd: C:\wamp\www\magento\index.php part: 1 positions: line like this it contain some 80k lines in each file how to solve this problem? thanks in Advance 回答1: That seems to be due to profiling enabled in

Filter product collection on two categories Magento 1.7

℡╲_俬逩灬. 提交于 2019-12-03 14:54:19
I want to get a product collection with products in Category A or Category B. I have been able to succesfully get these products with the following php-code: $collection = Mage::getModel('catalog/product') ->getCollection() ->joinField('category_id', 'catalog/category_product', 'category_id', 'product_id = entity_id', null, 'left') ->addAttributeToFilter('category_id', array('in' => array('finset' => 4,19))) ->addAttributeToSelect('*'); However, if the product is in both category 4 AND 19, then an error is displayed: Item (Mage_Catalog_Model_Product) with the same id "173" already exist This

How to change configurable product main image by associated product image based on color and size attributes?

岁酱吖の 提交于 2019-12-03 13:42:42
问题 I am using configurable product with size and color attributes. I want to change the main-image on configurable-product view as per the options chosen Like If I choose red-color then image of associated-product which has red color attribute value should display on main-image as soon as I choose the option. How can I do that?? Thank you... 回答1: I have found one solution for this problem for which I am working... There is one block at \app\code\core\Mage\Catalog\Block\Product\View\Type