Can I call magento login and register page in to a bootstrap modal? - bootstrap-modal

Can I call magento login and register page in to a bootstrap modal and when a customer add a product in their cart without logging in a modal popup instead of login page?

In default, Magento have a mini login form and we can use it any where in our page blocks.
Now I’m going to add this mini login form in our page header with in few simple steps.
First we want to add login form block to header for sign out customers. We can use our theme’s local.xml file for this purpose.
Just add below code snippet to our theme’s local.xml file.
<customer_logged_out>
<reference name="header">
<block type="customer/form_login" name="header_customer_form_mini_login" template="customer/form/mini.login.phtml"/>
</reference>
</customer_logged_out>
Then call this login form in header section of our template file.
<?php echo $this->getChildHtml('header_customer_form_mini_login') ?>
same applies for register form you have to create a mini.register.phtml file
with register.phtml code and change login in above codes to register

Related

Can I open a modal with URL parameters in Django to edit a form?

thank you in advance. I am creating a Django template that allows users to add / edit families information. I would like the ability to add my edit forms to a modal but am having issues passing the parameters of the URL.
url:
url(r'^family/(?P<pk>\d+)-(?P<nav_key>[A-Za-z]{4})-(?P<nav_id>\d+)-(?P<sub_key>[A-Za-z]{4})-(?P<sub_id>\d+)/$', family_view, name='family_detail_sub_key_id'),
HTML
<a href>:
<!-- This is where I need assistance with opening the modal -->
Again, thank you

Sitecore WFFM Form not working when inserted as a web control

I created a form which works if I add it as control to Presentation --> Details. What I need to do on another page is inserting the same web form as a web control like this:
<wffm:FormRender FormID="{72857A3A-B6C5-48C0-995B-FA053C82870F}" runat="server" />
The form is shown on the page, but the validations report not filled fields, although they are filled.
Am I missing something?
There you go. This is what you need to do.
<wffm:FormRender FormID="{72857A3A-B6C5-48C0-995B-FA053C82870F}" FormTemplate="/sitecore modules/web/Web Forms for Marketers/Control/SitecoreSimpleFormAscx.ascx" runat="server" />

Custom fields in confirmation email Opencart 2.0

I have created custom fields for my registration/checkout form with Opencart 2.0. They show up on the admin section under each order, and I have successfully added them to the order_invoice.tpl, but I need to add them to the confirmation email that is sent to the customer. I think I have located the correct controller file: catalog>controller>account>order.tpl But I think the issue is that the code used to print it out in the order_invoice.tpl is referencing a folder or file in the admin side.
This is the code I am trying to execute in catalog>view>theme>yourtheme>template>mail>order.tpl
<?php foreach ($account_custom_fields as $custom_field) { ?>
<strong><?php echo $custom_field['name']; ?></strong>:
<?php echo $custom_field['value']; ?><br />
<?php } ?>
This is the error I get:
Notice: Undefined variable: account_custom_fields in
/home/raphaelseventworks.com/www/ncbaorders/catalog/view/theme/journal2/template/mail/order.tpl
on line 70Warning: Invalid argument supplied for foreach() in
/home/raphaelseventworks.com/www/ncbaorders/catalog/view/theme/journal2/template/mail/order.tpl
on line 70
Does anyone know how print out custom fields in the order confirmation email? Or what code I need to add to catalog>controller>account>order.tpl to make this work?
Thanks!
If i am correct you are trying to send additional values to confirmation email after checkout
you need to work on
catalog/model/checkout/order.php::addOrderHistory()
After order is placed, the order history is changed, here you can load your view file and pass custom values form controller according to your need.
Good Luck

like detail page inside timeline page tab

I have a facebook timeline page tab app that's running inside an IFRAME on a fan page.
On the main page of the app, we show 10 jobs and users can click through to the detail page of one single book.
We want to add a LIKE button on those detail pages, so that users on facebook can like and share that job in their stream.
The app is totally dynamic so different customers can install the app on their fan page and list their own jobs. (ex. coca-cola installs it on his coca-cola page and lists jobs within the company. then microsoft installs it as well and does the same)
The problem concerns og:metatags and redirection of the liked detail page link, right inside the right facebook company page and relative right detail page showing the job.
I can get these two things done and working but not at the same time:
A. Facebook gets correctly the og:metatags in the head section, with image, title, description when I use the following implementation of the like button (without "data-href" extra attribute)
<div class="fb-like"
data-send="false"
data-layout="button_count"
data-show-faces="false"
data-action="like"
data-font="arial">
</div>
The problem is that not specifying the data-href attribute (and the og:url meta is totally ignored) this is gonna create a link to the current page => intended current page inside an iframe => so the result will be that when you click the shared job on facebook you will be redirected NOT inside the facebook app -right page -right detail page, but to the detail page on the server that hostes the app.
B. If I instead specify the data-href attribute
<div class="fb-like"
data-href=<%= "http://www.facebook.com/pages/:page/#{session[:fb_page_id]}?v=app_XXXXXXX&app_data=#{#job_details.job_id}" %>
data-send="false"
data-layout="button_count"
data-show-faces="false"
data-action="like"
data-font="arial">
</div>
Doing this I can get the right link posted on facebook (so then using &app_data attribute) I can get the perfect redirection working.
BUT on the downside, the og:metatags are totally ignored and instead facebook picks the page tab metatags (top iframe that hostes the pagetab app) and so I get posted on facebook a crap link that tells about a page on facebook with the page app picture. And the even bigger downside is that when you like a job on the app, all the jobs appear to be liked as well (basically the iFrame app becomes the liked page... instead of being the job detail page picked as liked page)
Is out there any genius that knows how to sort this out? I need to get the A an B working at the same time to get the requested result!!!!
Please help!!! :(
I've found the solution myself.
Like button => use href and ref attributes, especially put on the ref the id of your facebook fan page. Passing the current page url will also load and share correctly the og:metatags.
<div class="fb-like"
data-send="false"
data-show-faces="false"
data-layout="button_count"
data-font="arial"
data-action="recommend"
href=<%= "https://app.com/jobs/job_details.job_id" %>
ref=<%= FB_PAGE_ID %>>
</div>
Once you pass the ref attribute to facebook, on your wall the link will be posted by facebook with an extra query string appended with in particular the "fb_ref" parameter:
for example a button with parameters:
href=<%= "https://app.com/jobs/job_details.job_id" %>
and
ref=<%= 332325142248470 %>
becomes:
https://app.com/jobs/a0Ed000000a54bkEAA?fb_ref=332325142248470&fb_source=profile_multiline
when the user clicks the link we want to be redirected back right inside the correct page tab app and right job details page. To achieve this we set up into the controller/show action (that in ruby corrisponds to controller_name/id) a new redirection, remembering that ref will put inside a query string after our href link:
if params[:fb_ref]
redirect_to "http://www.facebook.com/pages/:page/#{params[:fb_ref]}?v=app_xxxxx&app_data=#{params[:id]}"
end
As you can see we create a new dynamic url that will use the "app_data" parameter of the facebook "signed_riquest" (http://developers.facebook.com/docs/authentication/signed_request/) in order to pass to our application the right detail page to be visualized and also redirect us to the right facebook page.
once done this we have just to manage correctly the new app_data parameter that comes now with the signed_request. In my case in one of my main controller I've used:
if fb_signed_request[:app_data]
redirect_to "/jobs/#{session[:app_data]}"
end
And we will see our app loading the right page and the right job detail page!
Hope is gonna help other people!

Django: How do I position a page when using Django templates

I have a web page where the user enters some data and then clicks a submit button. I process the data and then use the same Django template to display the original data, the submit button, and the results. When I am using the Django template to display results, I would like the page to be automatically scrolled down to the part of the page where the results begin. This allows the user to scroll back up the page if she wants to change her original data and click submit again. Hopefully, there's some simple way of doing this that I can't see at the moment.
It should already work if you provide a fragment identifier in the action method of the form:
<form method="post" action="/your/url#results">
<!-- ... -->
</form>
and somewhere below the form, where you want to show the results:
<div id="results">
<!-- your results here -->
</div>
This should make the page jump to the <div> with ID results.
It is complete client site and does not involve Django, JavaScript or similar.
You need to wrap your data into something like this:
<div id="some-id">YOUR DATA TO BE DISPLAYED</div>
and if you make redirect in your view you need to redirect to url: /some-url/#some-id
if you don't make redirect you need to scroll to the bottom using javascript (but note that redirect is preffered way to use in view after saving data).