Magento Event Observer: modify CatalogSearch to include custom attribute - events

I was following the article (Customize Magento using Event/Observer) on the below link:
http://www.magentocommerce.com/wiki/5_-_modules_and_development/0_-_module_development_in_magento/customizing_magento_using_event-observer_method#step_7
But not sure about the step 7. How could I do the step 7 on this article?
Step 7
Navigate to the product details page on the front end and observe that the new discount has taken effect. To be noted here is that, on all other screens where discounted price is required. An example here is the search results screen, where you would need to add this new attribute to the select query search attributes in method
Mage_CatalogSearch_Block_Result→_getProductCollection()
$_productCollection= $_productCollection->addAttributeToSelect('percent_discount');
Thanks in advance.

I think it would be a lot easier if you could just navigate to product attributes management and set 'Used in Product Listing' to 'Yes' this way, you are able to read the attribute value on product list page.

Related

Let Customers to Input a fixed product quantity in quantity box using a button or radio button in the product page in Prestashop 1.7.x

Greetings of the Day!
I need to have the condition on the product page where we can let our customers input a fixed product quantity in quantity box using a button or radio button in the product page along with the default functionalities with the add to cart mechanism.
Why I need this is because I am using the product volume discount list on the product page and I want the customer to select the quantity directly from the mentioned list.
Pls, find the screenshot attached for reference.
Screenshot for reference
Customers can select the quantity directly from the red rectangle shown in the image through a button/radio/link click.
Hope somebody will help me out with this for which I would be greatly obliged.
Thanks.
to achieve that you should change the responsible tpl file, unless there is an override you should find it in /themes/YOUR THEME NAME/templates/catalog/_partials/product-add-to-cart.tpl
There look for the block {block name='product_quantity'}, right after you will see the input used for it, just build your html structure being aware that you should keep the same name and probably also the same standard classes (but you can add yours as well).
After that style your new radio input in /themes/YOUR THEME NAME/assets/css/custom.css and the trick is done.
I hope you are familiar with tpl/smarty if you have to inject some vars from php, in case you don't need that it is just pure html and css.
Hope my answer helped.
Simone

Why is my wish list limited to one item?

Im using magento 1.9 and im having an issue with the wishlist, for some reason it will only let me have one item in my wishlist and when I goto add another item to the wishlist it replaces the item that was already in my wishlist, there is nothing in the configuration to limit the wishlist item im just a bit confused at why it would be doing this, any ideas ?
Right!!, after hunting the web to try and find a solution I have found a solution, you have to edit the file app/code/core/Mage/Wishlist/Model/Wishlist.php
find:
public function getItemCollection()
and change
$this->_itemCollection = Mage::getResourceModel('wishlist/item_collection')
->addWishlistFilter($this)
->addStoreFilter($this->getSharedStoreIds($currentWebsiteOnly))
->setVisibilityFilter();
to
$this->_itemCollection = Mage::getResourceModel('wishlist/item_collection')
->addWishlistFilter($this)
->addStoreFilter($this->getSharedStoreIds($currentWebsiteOnly));
this worked for me and im using magento 1.9.0.1
the source for this fix is here: http://www.magentocommerce.com/boards/viewthread/291225/
This is an out of the box feature, you do not need to edit any core code to fix this. Correction: You don’t have to edit any code
I had the same issue and found it was from an improper import of products and that website availability was incorrectly set.
It seems that Magento added a website filter on the wishlist collection to prevent items not available in a website from appearing in a customer's wishlist.
It also seems that items may not have a website value => which prevents wish list items from appearing (or just 1 item, the last one added).
How to fix it : Simply select your store products on catalog page, select ‘Update Attributes’ action and click on submit.
Select Websites panel and check your website in ‘Add Product To Websites’ block.
Reindex your data if necessary.
You can now add your products to your wishlist and see all of them in your wishlist. This is the proper solution and does not remove functionality from your Magento webstore.
Simply reindex everything in: System > Index management

make configurable product options independent on product view page --Magento

I am working on a Magento project and I need to know if there is a way to make a product's options independent to each other or unrequired. I need to use one of several at a time (I have 6 dropdowns).
I have tried add to cart by query string but all dropdown values were still required. I also tried to make all the options default, then modify the selected options in the observer, but I did not meet with success. See the screenshot below for more details.
Any help will be appreciated
Screenshot http://secure.justhost.com/~sharpwe1/img/imf.png
Configurable Products in Magneto are only parent products of Simple Products. Whatever you have as an attribute of a Configurable - a Simple Product has to be present for each. To do this out of the box in Magento, you should be looking into setting up a Simple Product with Custom Options.

Magento - Adding quantity box to upsell / related products

I have a question regarding Magento. I want to be able to add a quantity box to the products that show up in the 'related products' list that is shown on the product detail page. This way a visitor can order a related item multple times instead of only once per action. I have been looking for a solution for this for over 2 weeks, but I can't seem to find anything usefull. Can anyone help me out?
Thanks in advance!
Think you need to edit this template: your_package/your_theme/template/catalog/product/list/upsell.phtml. If you do not have that file already in your theme, simply copy it in your theme and package following the rest of the path.
There you can add you Qty input box and add Add to Cart button and change the URL to include the qty. You should bear in mind that you may have also configurable/bundle products displayed as an up-sell, so you should cover these too.

Hide buy button in product page in same products

I have one issue. It's able to make in magento that in some products don't show add to cart button. Because I want make these products just informational and not buyable.
Is any hack in magento like this?
You could add a custom attribute to your products that would mark them as not available for sale. After doing this, you can just modify your templates to not show the buy/add to cart buttons if the attribute is set to true.
Of course, good practice would suggest that you also prevent these products from actually being added to the cart manually, just hook an observer to the card add event and check for the attribute and skip if it's set to true.
It's not necessary to customize code
just set product stock 0 then enable Display Out of Stock Products
set product stock 0
Enable Display Out of Stock Products
Set Minimum Qty Allowed in Shopping Cart to 1
that's it.
When customer want to add product to cart, the system will not accept is because of the stock level.
PS : I suggest this technique is because of your request which you specified "but buyable" in your question.
Here is the extension Click here for extension which I guess is suitable for your question:
Call For Price

Resources