Let me know if you find errors or anything that can be done to improve it.
Marvin M.
You want to thank me for my time! Click here to donate
This guy was cool enough to take the time to update the xml out of his own time to help me finish a project I am working on! You are the man!
if so how do i add some questions etc as i can't find it on my admin panel anywhere sorry
admin_controller_sale_customer.php on line 357Notice: Undefined index: expert_id in /home/users/.../vqmod/vqcache/vq-admin_controller_sale_customer.php
ckonig wrote:Thank you!
I totally forgot to mod the system/library files to add a get Method, thats a nice one! As said, i did almost the same work before, and I merged your contribution with mine. This way, I also got rid of your problem concerning the empty field in the frontend.
But I have a question about your query manipulation. Wouldn't it be better to only add the field to the begin of the query, ignoring what comes after, so i can copy & paste the script as often as I want to?
For example with the UPDATE query:In my opinion this can only work one time, if I want to use two instances of this mod, I need to change it to:Code: Select all
<operation> <search position="replace"><![CDATA[$this->db->query("UPDATE " . DB_PREFIX . "customer SET firstname = '" . $this->db->escape($data['firstname']) . "',]]></search> <add trim="true"><![CDATA[$this->db->query("UPDATE " . DB_PREFIX . "customer SET expert_id = '" . $this->db->escape($data['expert_id']) . "', firstname = '" . $this->db->escape($data['firstname']) . "',]]></add> </operation>
This way I can use this script more than one and I dont have to mind what other scripts are doing with the query.Code: Select all
<operation> <search position="replace"><![CDATA[$this->db->query("UPDATE " . DB_PREFIX . "customer SET ]]></search> <add trim="true"><![CDATA[$this->db->query("UPDATE " . DB_PREFIX . "customer SET expert_id = '" . $this->db->escape($data['expert_id']) . "', ]]></add> </operation>
I also added the extra field into the backend views (list and detail view). If you're interested, here's my version (actually my field is called "expert_id"). I hope this helps.
what exactly do you want to do? The vqmod in my first post will add a new field called "cedula" to the registration form, cust edit, and to admin cust edit. You just need to substitute that for you custom field. Remember you also need to add the field to the database.smitch6 wrote:Hi i uploaded this to vqmod/xml was that correct?
if so how do i add some questions etc as i can't find it on my admin panel anywhere sorry
You want to thank me for my time! Click here to donate
Youre talking about the vqmod attached by ckonig?SVN wrote:error
admin_controller_sale_customer.php on line 357Notice: Undefined index: expert_id in /home/users/.../vqmod/vqcache/vq-admin_controller_sale_customer.php
ckonig wrote:Thank you!
I totally forgot to mod the system/library files to add a get Method, thats a nice one! As said, i did almost the same work before, and I merged your contribution with mine. This way, I also got rid of your problem concerning the empty field in the frontend.
But I have a question about your query manipulation. Wouldn't it be better to only add the field to the begin of the query, ignoring what comes after, so i can copy & paste the script as often as I want to?
For example with the UPDATE query:In my opinion this can only work one time, if I want to use two instances of this mod, I need to change it to:Code: Select all
<operation> <search position="replace"><![CDATA[$this->db->query("UPDATE " . DB_PREFIX . "customer SET firstname = '" . $this->db->escape($data['firstname']) . "',]]></search> <add trim="true"><![CDATA[$this->db->query("UPDATE " . DB_PREFIX . "customer SET expert_id = '" . $this->db->escape($data['expert_id']) . "', firstname = '" . $this->db->escape($data['firstname']) . "',]]></add> </operation>
This way I can use this script more than one and I dont have to mind what other scripts are doing with the query.Code: Select all
<operation> <search position="replace"><![CDATA[$this->db->query("UPDATE " . DB_PREFIX . "customer SET ]]></search> <add trim="true"><![CDATA[$this->db->query("UPDATE " . DB_PREFIX . "customer SET expert_id = '" . $this->db->escape($data['expert_id']) . "', ]]></add> </operation>
I also added the extra field into the backend views (list and detail view). If you're interested, here's my version (actually my field is called "expert_id"). I hope this helps.
You want to thank me for my time! Click here to donate
I was talking about the Expert ID.
OC 1.4.9.6
marvmen21 wrote:Youre talking about the vqmod attached by ckonig?SVN wrote:error
admin_controller_sale_customer.php on line 357Notice: Undefined index: expert_id in /home/users/.../vqmod/vqcache/vq-admin_controller_sale_customer.php
ckonig wrote:Thank you!
I totally forgot to mod the system/library files to add a get Method, thats a nice one! As said, i did almost the same work before, and I merged your contribution with mine. This way, I also got rid of your problem concerning the empty field in the frontend.
But I have a question about your query manipulation. Wouldn't it be better to only add the field to the begin of the query, ignoring what comes after, so i can copy & paste the script as often as I want to?
For example with the UPDATE query:In my opinion this can only work one time, if I want to use two instances of this mod, I need to change it to:Code: Select all
<operation> <search position="replace"><![CDATA[$this->db->query("UPDATE " . DB_PREFIX . "customer SET firstname = '" . $this->db->escape($data['firstname']) . "',]]></search> <add trim="true"><![CDATA[$this->db->query("UPDATE " . DB_PREFIX . "customer SET expert_id = '" . $this->db->escape($data['expert_id']) . "', firstname = '" . $this->db->escape($data['firstname']) . "',]]></add> </operation>
This way I can use this script more than one and I dont have to mind what other scripts are doing with the query.Code: Select all
<operation> <search position="replace"><![CDATA[$this->db->query("UPDATE " . DB_PREFIX . "customer SET ]]></search> <add trim="true"><![CDATA[$this->db->query("UPDATE " . DB_PREFIX . "customer SET expert_id = '" . $this->db->escape($data['expert_id']) . "', ]]></add> </operation>
I also added the extra field into the backend views (list and detail view). If you're interested, here's my version (actually my field is called "expert_id"). I hope this helps.
You're right! Thanks. Right now I don't have time to update it, I'll work on it as soon as I get some time free. I'll add it to the checkout registration and also the guest check out.victor.gatto wrote:you forgot to add the new field in the checkout registration??!?
You want to thank me for my time! Click here to donate
marvmen21 wrote:victor.gatto wrote:you forgot to add the new field in the checkout registration??!?[/uquote]
You're right! Thanks. Right now I don't have time to update it, I'll work on it as soon as I get some time free. I'll add it to the checkout registration and also the guest check out.
thanks heaps
You want to thank me for my time! Click here to donate
Code: Select all
ALTER TABLE `customer` ADD `name of your field` VARCHAR( 32 ) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL ;
You want to thank me for my time! Click here to donate
As victor.gatto notticed, I had forgotten the checkout/registration form...
So this is the updated version to include the "new field" to the checkout/registration form. Some might say it's also important to include the "new field" to the guest/registration form, and I first tried (you can see the commented parts in the xml file), but then decided not to since you're not going to be able to get that information because the cust is not creating any account. The only way would be to get the order_info form to show it in your backend which would take another bunch of files to modify. Anyways, It depends on the field and the information you're collecting from it, In my case, I just need it for people who actually create the account.victor.gatto wrote:you forgot to add the new field in the checkout registration??!?
You want to thank me for my time! Click here to donate
This new version now adds the "new field" to the affiliate/register & edit and to the backend. This is actually the vqmod I am using in my store, and that's why it adds the field called "cedula" at the beginning, just before "Name". You can change the position as you need.
Attachments
For OC 1.5.1.3. Now adds the field to the affiliate registration, edit, and back-end affiliate
You want to thank me for my time! Click here to donate
Code: Select all
<!--SYSTEM=>LIBRARY FILES-->
<file name="system/library/affiliate.php">
<operation><search position="before"><![CDATA[
$this->fax = $customer_query->row['fax'];
]]></search><add><![CDATA[
$this->cedu = $customer_query->row['cedu'];
]]></add></operation>
Code: Select all
<file name="system/library/affiliate.php">
<operation><search position="before"><![CDATA[
$this->fax = $affiliate_query->row['fax'];
]]></search><add><![CDATA[
$this->cedu = $affiliate_query->row['cedu'];
]]></add></operation>[/quote]
EDIT No need to correct that, I've updated the file.
You want to thank me for my time! Click here to donate
Noob alerte! Sorry, but I am having difficulties to understand the correct way to implement new fields.
I think I installed without any problems Vqmod, also the last New_Field_Registration_Form_1.1.xml form.
But how can I add a new field? I read that comment "<!--Copy and paste the code to add new fields, rememeber to add them to the database, too -->", so what does it really say? to copy all the code between <modification> or just a part of the code?
Also in the database, where do I insert the new field name?
Sorry I am very confused.
Hope you can help me.
Thanks.
The first thing you need to know is what kind of fields and where you want to add them. Knowing that will tell you what table in the database you need to add it and which files to modify.
In the case of this vqmod, this adds a new required field called "cedula" ( ID) just before "Name" in all registration pages except in the guest checkout. The mod is "plug and play" so by putting it in the xml folder, it will make all the modifications required. You can go to account/create in your website and see the field that was added. You may get errors since you also need that field in the database. To do that, you can use the following query to alter the customer table in the database
Code: Select all
ALTER TABLE `customer` ADD `cedu` VARCHAR( 32 ) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL ;
Now,if you want to add more than one field, let's say... a new field called "abc" just before "fax" , You will need to modify the code between the search tag to look for the position and add the field exactly where you want it, and add or copy paste code in all the operations you find in the vqmod. Basically, to add a new field you need to add code to all these files:Template files, controller files, mode files, and language files, and some files in the system/library.
This would the example on how to add abc to the template file.
Code: Select all
<!--###CATALOG=>VIEW FILES###-->
<!--standard register-->
<file name="catalog/view/theme/default/template/account/register.tpl">
<operation><search position="before"><![CDATA[
[b]<td><?php echo $entry_fax; ?[/b]></td>
]]></search><add><![CDATA[
<tr>
<td><span class="required">*</span> <?php echo $entry_abc; ?></td>
<td><input type="text" name="abc" value="<?php echo $abc; ?>" />
<?php if ($error_abc) { ?>
<span class="error"><?php echo $error_abc; ?></span>
<?php } ?></td>
</tr>
]]></add></operation></file>
You want to thank me for my time! Click here to donate
Users browsing this forum: No registered users and 33 guests