Magento: Add New Field to Credit Card Form - magento

I'm trying to modify the credit card form to add some new custom fields named "Bank Name" and "Bank Phone Number" and it seems this cannot be done through the back-end.
I've searched the web and on here but I haven't been able to find anything in reference on how to add a new custom field to the credit card form. I would think it's almost the same as adding a new field to the customer registration form but I have no clue what to do database wise.
If anyone has anything I can use to work on this, I'd greatly appreciate it.

You should start by informing which version of Magento you are using and which methods you have already tried.
Without knowing that it is hard to help you, but you might want to try this possible solution, this one, or even one of these modules: Checkout Fields Manager or ADDITIONAL CHECKOUT ATTRIBUTES. If none of the above work, try this search.

No, Magento admin panel will not add custom columns for you. You need to do it yourself.
First, you need to edit the .phtml file to include these two fields to show up in frontend.
Second, you need to add two new columns (with same name as your fields, explained later) in relevant DB table (i guess sales_flat_order_payment). But that will affect for all payment methods, so define it something like VARCHAR(255) NULL.
Third, when Magento saves the CC info, you need to check if it is saving whole data array, then your field's name posted will match your table field and get inserted automatically. Else you need to edit it.
Also, next time please post some code, atleast something you have tried.

Related

Laravel: A field that lookup another field from different table

I use Backpack for Laravel.
I know that to add a field, we can use:
CRUD::addField(['name'=>..])
But, I don't know how to add a field that lookup another field input from different table to show a lookup value.
Please look at the illustration below.
Thanks.
Edit:
I found a temporary solution to this, but not effective.
Reference: https://backpackforlaravel.com/docs/4.1/crud-how-to#add-a-select2-field-that-depends-on-another-field
With select2_from_ajax you still have to select the option (even its just one option left), meanwhile what I really want is its automatically select that one option.
It's depends on what you need to do. You can use relationship field and show a select with the list of user. If you really wanna do it like this. You can probably make an ajax request to show it. In that case you ll need to use a custom view for the edit or the create view.

Display the list of products in a tab

In my magento application i want to create a module which is for adding FAQ for a individual product. So while adding the FAQ, in the new tab i want to show the list of all products(like product listing) for which product we want to add FAQ.
So please help me how to customize for getting list of products and display in the new tab?
The question is too broad friend. So don't hope any full solution here. That is because, this question is related to an external extension. But you will get guidance here. Here you may need to do following things.
I think in admin, the extension provides provision to manage each individual faque. What you need to do is, you need to create an extra field that will relate that faq with a product or multiple products.
If you set up this, you need to store this information in database. So for each faq, there may be a product id or multiple product ids related to it
Now you need to create a new block for your extension. This block will filter faqs that related to a particular product.
Next step is add above block in layout. Layout handle you need to use here is catalog_product_view.
Create a new template for your custom block and in that template file, you need to put design codes. You can create this template with the help of current template that this extension uses. That way, you can reduce a lot of time for creating the design.
Hope that helps !

How VirtueMart sends the data when you save the custom fields in a product

first of all, sorry for my english, but I'll try to explain myself best I can.
My question is little tricky, because I made some important changes in the core code of VirtueMart.
For some reasons, I added an attribute to the Custom Fields, like Price, called Availability.
TIP: The admin site is in Spanish. Disponibilidad = Availability
So, now, when I try to change any value of any created Custom Field, I can't save it. I mean, I can change the value, but when I apply them, It doesn't be saved.
The only field that I can change, is the field I created, the Availability (ironically).
So, my principal question is, how does VirtueMart to pick up the data from the table and sends them to the database?
I work with
Joomla v.2.5.11
VirtueMart 2
Thanks
The workflow is like follows,
When you save the products details on the backend , It calls a function store() on the product.php model. under administrator/components/com_virtuemart/models/. Inside this function an area like follows.
if(!class_exists('VirtueMartModelCustom')) require(JPATH_VM_ADMINISTRATOR.DS.'models'.DS.'custom.php');
VirtueMartModelCustom::saveModelCustomfields('product',$data,$product_data->virtuemart_product_id);
It loading the custom model file from the same path and do the task inside saveModelCustomfields()
Hope it helps..

Retrieving articles based on custom URL parameters

I'm a beginner using Joomla 1.5. I have a page which shows articles in a blog format. My objective is to show/filter the articles per year (which isn't that many) based on user input. I'm planning to create a module on the right side, showing a dropdown box of the years, and retrieve the results by passing the year parameter as part of the URL
Ex.
http://sample.com/index.php?option=com_content&view=category&layout=blog&id=39&Itemid=24&year=2011
What is the best, simplest way of passing and processing additional parameters to com_content via URL? Can I do so using extensions such as K2 and flexicontent? If not, can someone advise me what code to add and where, in com_content? If I have to extend com_content itself, can someone guide me how to or point some useful articles?
Appreciate the help. Thanks
I don't know if K2 or flexicontent offer this option, but com_content appears NOT to have this feature.
I would just build a module, create a query and use the table jos_content, select only the fields that you need (like title) and check the field created to be in the year you need.

Problem with importing Quote Products in CRM 2011

Hi I am having a problem with importing Quote products in CRM 2011.
When I downloaded the template for import, the columns require that I state whether the product is a 'Write-in' or an 'Existing' product. Then there are an additional 2 columns: Write In, Existing.
On filling in the template with sample data for import, I wrote something like this:
Write-in | | New product |......
Existing | Existing Product 1 | |.......
(The | is a new column )
I am assuming that when the product is a write-in product, you must enter a new product and when the product is an existing product, you write the name of an existing product in the system. The other columns are then left blank.
However, I am getting errors on import and I have no clue why :/ I am giving it the wrong data?
Also... the company does not make use of a Product List. Is there a way in which I can bypass its use since every time I enter a new product, I am asked to give the price list and this is not viable for the company since there are hundreds of products and the items and their prices change constantly so we cannot make use of a Product List especially when I am asked to enter a New Product List every time :/
Does anyone have a clue of what can be done? Thanks :)
IMHO, I can suggest the following.
Have a default price list, Onload of such forms, autofill that field with that PriceList.
Also, when quote is created, use JScript to say there is always going to be a write In product. (Then, you dont require the Product Lookup filled in).
Also, I dont know what kind of errors you get here, but when you specify an existing product, you also have to specify the UniOfMeasure or something. Make sure you have one supplied in your CSV.

Resources