magento-1.7

Correct usage of addAttributeToFilter in Magento

生来就可爱ヽ(ⅴ<●) 提交于 2019-12-06 02:56:17
I'm having issues filtering a product collection with a customer attribute using 'addAttributeToFilter.' I have a dropdown menu attribute with the options 'yes' and 'no' and I'd like to to show only a list of products with the attribute set to 'yes.' I'm currently using: public function getReleasesCollection() { $products = Mage::getModel('catalog/product')->getCollection() ->addAttributeToFilter('preorder', array ('eq' => 1)) ->addAttributeToSelect('name') ->addAttributeToSelect('releasedate'); However this does not return any products. I have also tried using: ->addAttributeToFilter(

Cannot initialize the indexer process

拟墨画扇 提交于 2019-12-06 01:55:25
Sorry for the question duplication, but I couldn't find the answers to the question, so I am posting it again. I tried re indexing the magento 1.7.0.2 via admin. Since the server is shared server, I cannot run the indexer via shell script; though I tried running it through cron, but it didn't worked either. After running the indexer process, I got the following error logged in the the exception.log file: 2013-07-14T17:03:55+00:00 DEBUG (7): Exception message: Cannot create table without columns comments Trace: #0 /home/username/public_html/demo/app/code/core/Mage/Catalog/Model/Resource

Removing a custom attribute in Magento via an installer script

走远了吗. 提交于 2019-12-05 20:15:24
I have the following code in an installer script & need to now remove the is_school attribute via the installer script, is my code correct? // code within existing installer script (this works fine) $installer->addAttribute("customer", "is_school", array( "type" => "int", "backend" => "", "label" => "Is School?", "input" => "int", "source" => "", "visible" => false, "required" => false, "default" => "", "frontend" => "", "unique" => false, "note" => "" )); My intended approach to remove the attribute - does this look correct? $installer->startSetup(); $installer->removeAttribute('customer',

Programmatically created configurable item doesn't show options until I manually save it in the admin panel

只愿长相守 提交于 2019-12-05 19:53:33
I am creating a a configurable product in code (am doing an import module) and everything looks Ok. The attributes are added, the simple stock items are added to the configurable product with no problems however, when I view the item on the font end it shows as a simple product would (without options) but when I save open and save the product in the admin panel it then shows the options on the front end correctly. I am using the following code before and after the re-save of the item to check if any attributes don't match (assuming I have missed something) foreach ($product->getTypeInstance

Disable a Magento mobile theme for tablet & iPad

不想你离开。 提交于 2019-12-05 17:29:12
I made a website that include desktop as well as mobile theme. It works perfectly fine, but in tablet & iPad it shows mobile theme that I don't want. so I use the following exception (iPhone|iPod|BlackBerry|Pre|Palm|Googlebot-Mobile|mobi|Safari Mobile|Windows Mobile|Android|Opera Mini|mobile)|(!iPad|Silk|Kindle|Xoom|SCH-I800|Tablet) but now also it shows mobile theme. Please help me how can I call desktop theme in tablet & iPad. I try a lot of strings. At last by using this string: iPhone|iPod|Mobile problem is solved. It shows desktop theme in table & in mobile shows mobile theme. For me, the

how to disable an option already selected in another <select>?

 ̄綄美尐妖づ 提交于 2019-12-05 14:25:56
I have five HTML selects with different values, but the options have the same text. How do I compare the text options, instead of the values, and disable the the respective option in every other select? For example, if I have: <select name="options[70]" id="select_70"> <option value="1" price="0"> test-1 </option> <option value="2" price="0"> test-2 </option> <option value="3" price="0"> test-3 </option> </select> <select name="options[71]" id="select_71"> <option value="4" price="0"> test-1 </option> <option value="5" price="0"> test-2 </option> <option value="6" price="0"> test-3 </option> <

How to validate radio button in magento?

大兔子大兔子 提交于 2019-12-05 11:11:55
问题 In my custom module I have a form which has radio buttons. When I click the submit button it does not validate the radio button. How to validate that using the Magento default validate class. Thanks 回答1: i got the answer, use validate-one-required-by-name in the class name of the radio button. Cheers Edit: or use validate-one-required on the last radio/checkbox in the group Thanks to Rahul Tripathi 回答2: Validation works, but to show error message you can't use any wrappers. Just <label> and

Magento - 404 error in public product page

≡放荡痞女 提交于 2019-12-05 10:28:13
I have a Magento 1.7 web width 2 stores in different languages width a direffent domain for each store. When I enabled products for the second store, the public product pages of the second store stopped functioning. Now are 404 error, but the first store product pages continue to perform well. All other pages work correctly. http://www.bioaigua.es/grower-abono-de-crecimiento.html - OK http://www.bioaigua.net/rooty-enhances-the-formation-of-roots.html - 404 error Any idea? Nerjuz Go to your DB and run this SQL query: INSERT INTO `report_event_types` (`event_type_id`, `event_name`, `customer

Deleting a large number of Magento coupons (shopping cart price rules) programatically

≯℡__Kan透↙ 提交于 2019-12-05 09:59:31
I've been on here before asking about writing code to get Magento to generate a random coupon code for a new e-mail subscriber - Creating a single random Magento coupon This code worked perfectly and to those who helped I am eternally grateful. I am now looking for a way to delete these coupons as they expire in a bulk fashion because deleting them individually through the Magento admin is a huge pain. As you can see from the picture below, in the span of a couple of days we generated over 300 coupons (all now expired). Would modifying the create coupon code detailed in the link (from my

Magento 1.7.0.2 change product image on hover in catalog page

旧巷老猫 提交于 2019-12-05 08:00:41
问题 I want to change images of products on mouse hover in the catalog page as you can see in this magento theme : http://www.ethemeuk.com/dresscode/index.php/women-10/club-dresses.html Thank you and i wait your reply. 回答1: If you want to show thumbnail image on mouse over & after mouse out show small image then go through : app->design->frontend->default->your theme->template->catalog->product->list.pthml in this Search this code: <a href="<?php echo $_product->getProductUrl() ?>" title="<?php