You are here:  » Category for Merchant


Category for Merchant

Submitted by smithdp1 on Mon, 2014-04-28 22:22 in

David, I would like to know how to add an additional drop down for merchant location(U.S. or U.K. in my case) while registering merchants. This way I can devide them on the front end when displaying /merchants.php. I can add the extra field in the database called 'location'. I have already added the drop down in /feeds_register_step2.php like this:

print "<br /><br />";
print "<strong>Merchant Location:</strong><br />";
print"<select name='merchantCat'>
<option value='uk'>UK</option>
<option value='us'>US</option>
</select>";

My question is:
Where and what file can I set this field to the appropriate value?

What file inserts the record?

Submitted by support on Tue, 2014-04-29 07:17

Hi,

First of all, add the new field eg "merchantcat" as per the standard instructions on this page.

With that in place, first implement the steps described in this comment to set-up the field to work exactly like the Category and Brand fields, with the option to enter a global value for the feed as an alternative to mapping to a field.

Test that all is working OK up to that point, and that you can enter "uk" as the custom field value for the feed and that it is imported as expected. Finally, you can replace the text box with a drop down by replacing this code:

$prefixHTML = "<input type='text' name='user_keywords' value='".$userKeywordsDefault."' />&nbsp;or use field&nbsp;";

...with:

$prefixHTML = "<select name='user_merchantcat'>
<option value='uk' ".($userMerchantcatDefault=="uk"?"selected='selected'":"").">UK</option>
<option value='us' ".($userMerchantcatDefault=="us"?"selected='selected'":"").">US</option>
</select>&nbsp;or use field&nbsp;";

If you're not sure of any of the changes of course let me know and I'll forward the modified files for you.

Cheers,
David.
--
PriceTapestry.com

Submitted by smithdp1 on Tue, 2014-04-29 09:19

David, thank you. If you could please email the mods to me just so I can compare and see exactly.

Thanks again!

Submitted by support on Tue, 2014-04-29 11:44

On way!

Cheers,
David.
--
PriceTapestry.com