English 中文(简体)
magento custom link and insertion of form data
原标题:

I have added a link named "campaigns" to the Magento "My Account" area after the Address book. The link, when clicked, should have a form with 4 fields:

name
email
number
place

Once they submit the form, it should insert these fields in the table. But again, can I want to have custom table for this. I have added this link in the xml file of /fronend/base/default/layout/sales.xml like this:

<action method="addLink" translate="label" module="sales"><name>orders</name><path>sales/order/history/</path><label>My Orders</label></action>`
<action method="addLink" translate="label" module="sales"><name>campaign</name><path>sales/order/history/</path><label>Missing orders</label></action>

Now I m confused as to which controller and model I have to call, etc.

Please point me in the right direction.

问题回答

To create a new entity (Campaign, for instance) and allow users to manipulate them, you ll need to define some classes for that new entity. This tutorial can help you create new EAV models in Magento.

Once you ve done that, you ll need a controller (to run actions that will display your form, save entities, show all the entities, etc). Try this tutorial as a starting point.

You ll need to change your path (and it seems your label is off) for your link to accommodate your new controller and show users content as you ve specified.

Let me know if you have more questions.

Hope that helps!

Thanks, Joe





相关问题
Magento addFieldToFilter allow NULLs

When using the Magento collection method addFieldToFilter is it possible to allow filtering by NULL values? I want to select all the products in a collection that have a custom attribute even if no ...

Get product link from Magento API

I am new to Magento and using their API. I need to be able to get the product url from the API call. I see that I can access the url_key and url_path, but unfortunately that s not necessarily what ...

magento extension installation

I want to install a Magento extension in WAMP, but not from the Magento connect system. How can I do this? I have the module (extension) code and I already installed the sample data in the Magento ...

Link to a specific step in onepage checkout

Is it possible to redirect the browser to nth step in the onepage checkout? If so, how would one go about doing it? I m working on a payment module and have a sort of "cancel" action that i would ...

How do I filter a collection by a YesNo type attribute?

I have a ‘featured’ attribute, which has a Yes/No select-list as the admin input. I presume that the values for Yes and No are 1 and 0, as they are for every other Yes/No list. However, if I try and ...

热门标签