I would like to add three fields in customer creating section of magento backend.
Customer Card ID
Customer Store No
Customer Store Name
Those fields should save into magento database then can query/show in onepage checkout ( we would like to send automatic mail of related stores customer relationship department).
Could you please help me to make such a things in magento?
first you need to decide if those attributes are customer attributes or customer address attributes or both together. Then add the attributes to customer and/or billing/shipping address objects (preferable with setup script) and then add the fields to all templates you might need. You also might need to extend the user data validation class.
Related
I have a magento website (1.9.2) and I have various products from various suppliers. I want to add the information of the supplier on every product's description. That information will be a logo, some contact details etc.
Is it possible to generate a static block for each supplier and include it in each of his product's description?
Is there any more "automated" / "proper" way to do this? Like having a list of suppliers/manufacturers and have a field in the product that points there and their info is automatically included in the product's description?
Any hints & tips are welcome.
There are two possible way to achieve this:
Option 1: Create Suppliers attribute and assign to each products. Using suppliers name create static block for each supplier that contain the supplier Logo and contact details.
On the Product details page fetch the products assigned supplier and using the name as static block ID, include static block on product detail page like below:
$this->getLayout()->createBlock('cms/block')->setBlockId(strtolower($supplierName))->toHtml()
Option 2: You can install shop by brands extension that provide complete separate module to manage brands. like below:
https://www.magentocommerce.com/magento-connect/shop-by-brands-by-zeon-solutions.html
then using the extension function you need to fetch brand (supplier) information on product details page.
I prefer to use Option 1 if you don't provide Shop by brand option in frontend.
I have added a custom field in checkout page at shipping method step in magento. I am able to insert data from this field to my custom table mg_cake_message(msg_id,customer_id,cake_msg). I need another attribute (order_id) to show data for respective orders in admin panel. How can i get order_id before submitting an order?
I have searched in google and some of people suggest to use quote_id instead of order_id. Is quote_id is same as order_id ?
If it's not possible to get order_id before submiting order then how can the two previous step(Billing Information, Shipping Information) is managed?
Please make me a response .....
A quote in Magento is basically an order that hasn't been placed yet. It contains product items (shopping cart), addresses and payment/shipping methods. It is created as soon as you add an item to cart and Magento creates a sales/quote object.. During checkout, billing and shipping data is added to the quote. Finally, when the user clicks place order, the quote object is converted to an order sales/order object.
I have a business requirement that execs are really wanting to see. In our lead and email templates we have a few of our products listed. The products themselves are pretty stable but the prices are of course subject to change.
I'm OK with hard coding the product name into email but I was hoping the price could be a slug that get's resolved.
We only have one price list so nothing to worry about there.
I see no way to get access to the product and or price list entities through the data field values dialog.
So my thought was to create the 2-4 fields in the lead and opportunity entities. Then create a background workflow that takes the price from the price list and sets those fields.
Then when an email is generated I can access those hidden fields as they will be available through the lead or opportunity entity.
Any thoughts, concerns, better approaches?
Unfortunately CRM's email template system is not capable of what you describe out of the box. As you have discovered it will only permit you to insert placeholders from, or assocated with, the primary entity. It won't let you insert fields from other entities. What you suggest as a workaround is possible but it's not an ideal solution as you'll have these 2-4 redundant fields on each record type that contain duplicated data from the price list.
If you have any experience with creating custom workflow activities using the SDK then the best solution here is to create a custom activity that accepts either an draft Email or Email template as a input parameter, instantiates the email if required, loads the price list data, and performs your own custom placeholder replacements.
I've done this on a few projects in order to pass multiple entity records into the template, or to insert complex tables into emails by loading data from relationships. See the screenshots below for an example of how I've configured the email template and dialog process to pass both an 'Account' and 'User' record into the email template.
Through which file are new customers created and saved in Magento databases?
Which function is used?
Please provide me with full path locations and function names.
Also tell me about customer groups. From where and through which files/functions do customer groups get saved in Magento?
How are customers and customer groups related?
How can I "catch" customer IDs and customer group IDs from those files?
I find the file through which Magento saves New Customer-:
/magento/app/code/core/Mage/Adminhtml/controllers/CustomerController.php
In the file CustomerController.php, there is a function saveAction() which saves a customer in Magento db.
I wanted to know how to catch Newly created customer's id(I guesss i.e. Entity Id in Customer_entity table for Magento db) from that CustomerController.php file.
I tried this but it won't work for me-"
$customer_data = Mage::getModel('customer/customer')->load($customer_id);
Anybody knows how to catch customer id while creation of new customer???
Try to search here:
Mage_Customer_AccountController->createPostAction
Well class name means
(root)/app/code/core/Mage/Customer/controllers/AccountControlller
Mage_Adminhtml_Customer_GroupController
Take a look at the AccountController.php at app/code/core/Mage/Customer/controllers, it will give you an idea how customer registration is processed.
Basically an instance of Mage_Customer_Model_Customer is created, proper data is assigned to it (collected from a post form on the registraton form or received via a webservice call) and the model is saved. The internal Magento mechanics work to put this data in proper db tables.
See also create function of the Mage_Customer_Model_Customer_Api class.
customer groups are created in Mage_Adminhtml_Customer_GroupController->saveAction(), the model being used is Mage_Customer_Model_Group
actually customer group is assigned from backend,by default general group is selected for customer group, if you want to get customer groups then you can use this code Mage::helper('customer')->getGroups()->toOptionArray();
Search for this file
/YourProject/app/code/core/Mage/Customer/controllers/AccountController.php
Search for this function name
public function createPostAction() //Magento saves New Customer
This above mentioned function is responsible for new customer registration.
print_r($this->getRequest()->getPost()); //get all the post data
print_r($session); //get all the session data
I've never set a store up to use Price Alerts before, and now that I've gone through and gotten it to work, it appears as though the alert is only triggered when a product's 'Price' attribute changes.
This is nice, but what about tiered pricing? Looking through the ProductAlert core module, I am not sure where this attribute is being filtered.
I'm guessing that an additional model, say 'productalert/tierprice' will need to be created, followed by a new method in Observer.php, likely _processTierprice(). Just not sure if this concept is correct... could use a little guidance.
Thanks!
This shouldn't be too difficult; lots of options (it's Magento, after all)!
I'd add new methods to deal with tier price alerts. For products with tier pricing, you'd need to capture the relevant tier data along with the final price (either in a new table or in new columns on the existing product alert table). The alerts are sent out via scheduled job. So, in a nutshell (overrides where necessary):
Alter the product alert schema as necessary, and amend the frontend form fields to suit
In the overridden Mage_ProductAlert_AddController add a tierPriceAction() method to process the alert subscription, or adjust its existing priceAction() to handle the data being posted in / tier condition
Override Mage_ProductAlert_Model_Observer as needed; I'd include a _processesTierPrice method() similar to _processPrice().
Add a resource model method to get the tier-related prices
Add a tier price email block and template (reference Mage_ProductAlert_Block_Email_Abstract)
Profit!
As a reference for your price logic, see Mage_Catalog_Model_Product_Type_Price.