Retrieve product subscription alerts from a customer in Magento - magento

I'd like to create a new area on the «My account» section that shows to the customer all the products he's been subscribed to by clicking on the «Sign up to get notified when this product is back in stock» button in the product page (a product that is not in stock, of course).
There is other thing that I'd like to do related to this. When customers click on that button, it's still present on the product page, even when the customer has already clicked on it. How can I make this button disappear when the customer has already clicked on it?

I finally found the solution for this. It's really easy. To get the products that a customer has been subscribed to:
$customer_product_alerts = Mage::getModel('productalert/stock')
->getCollection()
->addFieldToFilter('customer_id', $customer_id);
This is for stock alerts. If it comes to price alert, just use the productalert/price model.

Related

Get quote id on admin new order create page

I want to add one price match textbox when admin try to create an order.
Like this:
so when customercare got a customer for price match they just enter amount difference then we give total discount to customer. But I am faceing big problem so when user add amount press enter I am pinging one controller but in that controller I am not able to get quote id I am using:
$session = Mage::getSingleton('adminhtml/session_quote')->getQuote();
echo $session->getId() or $session->getQuoteid();
But I am not able to get quote id. And is there any why we can do that. Because we don't want customer item price we want to give full cart discount which help our account team to do there work easily.
There is one more default way to do this.
1) When you create an order from backend, you enter the customer detailed first.
2) When order page opens, there is a button where says "Add Products", click on it, select the product you want to map with this order.
3) Later, customer will tell the price which means you want to have custom price. In this case there is a checkbox called 'Custom price' under every product item you have added with "Add Products" option (Inside "Items Ordered).
4) When you click on this checkbox, an input will be visible in which you can enter the discounted price. Once you enter the custom price, click on the button below called "Update items and qty's".
5) Item's price will get updated with your custom price. You can proceed with the further order processing now :)

Opencart 2.x.x. cart to enquiry basket

I am a newbie on opencart. I want to change the working of cart button. Actually, i dont want to show the prices of my products instead i want my customers to contact me for quote.
So, i want my cart button work in a way that when user click on checkout button, a form open (instead of paypal) in which cart added product names and ID written with other fields like name, email etc so that the user can get a quote from me.
I also want to change the add to cart text to add to basket and checkout text to Get Qoute.
Please help me, i know my issue is very complex and large. And i also know that you can do that.

To show product on a particular category

I am trying to show a customer his active subscription that he has purchased till a date. I have a category called my subscription what I want is that when a user logged in and he purchased a subscription further he goes to another category called my subscription where he can see his subscription I want to show his subscription (i.e virtual products) on that category. Right now neglecting the logged in condition I just want that user fetch sku from database and show at any category where I want.
I am not able to bring the product as a whole but able to collect product information.

User message not showing in product view page

In one of the Magento store, I have to restrict customers to add a product more the one time.
I checked with the cart and pass an error to the customer. But Magento does not show any message in product view page.
Mage::getSingleton('core/session')->addNotice('You have already added this product in your cart');
Check the above code, I placed it in controller file. I thought it was correct. Let me know what I missed.
I'll add an explanation later, try this:
Mage::getSingleton('catalog/session')->addNotice('You have already added this product in your cart');

Why are my related products not displaying on my product page?

I have gone to admin -> manage product -> product information page -> related products
Then I added a product that is related, and saved.
I went to that product and refreshed the page, but nothing changed. Why not?
Also, be sure to check that the product you're trying to see in 'Related Products' is not already in your cart. Magento has a default filter applied that removes items in the cart from the related products collection.
Solution:
Login to Admin
Go to System -> Index Management
Select All checkboxes
Select 'Reindex Data' from Actions selection list
Click Submit button
Reference: Magento Up-sells Cross-sells and Related products are not showing up
Related Products appear in product info page, in the right column.
Cross Sell items appear in the shopping cart.
Upsells for this product are items that your customers would ideally buy instead of the product they’re viewing.These appear on the product info page underneath the product description.
As a result, I understand that you would show products bottom of the product info page, you should choose upsells instead of related products.
If you want related products ( which I can misunderstanding you ) do following things :
Check related product status is enabled.
Check visibility status set "Catalog" or "Catalog Search"
If everything is fine, check the inventory of related products.Stock should be greater than 0.
Last thing, related products must be include a category. Click "categories" link to check and see if the product added in a category.
Click on the "Reset Filter" button on top of the related product listing. It will list all products in table. Or you can clear cache + reindex data.
I had the same issue. After some time ago, I found that the products are not made to be visible in the visibility section, and that the products are not set to be in any website.
Hope this is the answer, and should be, because if you set up everything right there is nothing that can make problems.
Make sure the product and related product are under the same website. This isn't apparent when adding the relating products.
One possible pitfall you can run into is that you use a template without a right column. In that case you have to use unsetChild and insert to move the related product block.

Resources