Show Vendor Registration Form On Home Page

Hi there,



We are using Cs-cart MV 4.0.2 and want to to display the vendor registration on the home page. As evident the vendor registration file is in the apply_for_vendor.tpl



So how can we display it on home page using my changes addon or any other changes using hooks.





Regards,

NaMo

Hello NaMo!



Why not to try a more simple way. You can, for example, place a banner (Apply for a vendor account. Easy registration!) on a homepage linked to the Vendor registration form. Or just create an HTML block with the link to the Vendor registration form. Both the banner and the block will attract the attention of your potential vendors.



Best regards, Alt-team

Hello Alt-team,

Instead of linking the vendor registration page via an image banner we want to put the form on the home page so that the store looks more like Shopify home page and vendors can register from the home page only.



How can modifications so that the apply_for_vendor.tpl can be displayed on the home page also?



Regards,

NaMo

Hi @NaMo,

Do you need a block that can be positioned on the homepage, or home to be replaced by vendor registration ?



Keep on smiling,





Valentin

[color=#808080][size=2]part of hungryweb.net[/size][/color]

Hi Valentin,



I need a block that can be positioned on the homepage.



Regards,

NaMo

Do you need all the fields from [color=#ff0000]apply_for_vendor.tpl[/color]?





Valentin

[color=#808080][size=2]part of hungryweb.net[/size][/color]

Not all as I've customized the form and made it appear more like shopify one.



i.e. only Name, company and email

shopify.PNG

I cannot see all image, but i can create for free the block with the desired fields, but for the customization like small image i see, you need to use hungryweb.net/get-a-custom-quote





Valentin

[color=#808080][size=2]part of hungryweb.net[/size][/color]

Hi Valentin,



I've done the customization in the [color=#ff0000]apply_for_vendor.tpl. [/color][color=#000000]I only need to know how to use the code and put it in a block/hook or whatever it would be.



Regards,[/color]

[color=#000000]NaMo[/color]

Hi Vali



Can you just create the block with the Name, company and Email fields?



Regards,

NaMo

Please add to file
design/themes/THEME_NAME/templates/addons/my_changes/blocks/static_templates/apply_for_vendor.tpl


#content


{include file="views/companies/apply_for_vendor.tpl"}




Now go to Design > Layouts, Homepage and add a new block Template and on the select you will find [color=#ff0000]_apply_for_vendor[/color] option



In the block just created will add content of the page apply_for_vendor but you need also php behind it



Please copy to file [color=#ff0000]app/addons/my_changes/controllers/frontend/index.post.php[/color]

```php

if (!defined('BOOTSTRAP')) { die('Access denied'); }
use Tygh\Registry;
if($mode == 'index'){
$restored_company_data = fn_restore_post_data('company_data');
if ($restored_company_data) {
Registry::get('view')->assign('company_data', $restored_company_data);
}
$restored_user_data = fn_restore_post_data('user_data');
if ($restored_user_data) {
Registry::get('view')->assign('user_data', $restored_user_data);
}
$profile_fields = fn_get_profile_fields('A', array(), CART_LANGUAGE, array('get_custom' => true, 'get_profile_required' => true));
Registry::get('view')->assign('profile_fields', $profile_fields);
Registry::get('view')->assign('countries', fn_get_simple_countries(true, CART_LANGUAGE));
Registry::get('view')->assign('states', fn_get_all_states());
}
```

PS: My Changes add-on must be active

---
Valentin
[color=#808080][size=2]part of hungryweb.net[/size][/color]

Hi Valentin,



Thanks a lot for the code. You made my day. :-)



But there’s one error. When someone tries to signup from the home page then it redirects it to

http://www.sitename.com/applyforvendor i.e. the original form url for vendor creation and displays the errors/confirmation message.



How can this be fixed?



Regards,



NaMo

Please change the file [color=#ff0000]app/controllers/frontend/companies.php[/color]



#replace
$return_url = !empty($_SESSION['apply_for_vendor']['return_url']) ? $_SESSION['apply_for_vendor']['return_url'] : fn_url('');
unset($_SESSION['apply_for_vendor']['return_url']);


#with
$return_url =fn_url('');






Valentin

[color=#808080][size=2]part of hungryweb.net[/size][/color]

Hi Valentin,



This works fine but probably if the user sign's up from [url=“http://www.sitename.com/applyforvendor”]http://www.sitename.com/applyforvendor[/url] then in this case he is redirected to home page.



So can't we modify the controller in such a way that instead of redirecting he is notified on the page from which he is registering.

Please send me a link to site to understand better





Valentin

[color=#808080][size=2]part of hungryweb.net[/size][/color]