How to redirect user to login before he can add products to cart and disable AJAX Cart - NopCommerce - nopcommerce

I am using NopCommerce version 3.0. I want the users to get redirected to the login page before they can add products to the cart. I also want to disable the AJAXCart (I want full postback and the products to get added to the cart.).
Please guide me as to how to achieve it.
Thanks.

I have done something similar here: http://clinidirect.co.uk/c-20/continence-care if you add an item to the bag, a popup appears, if you click on "Go to bag" it asks you to login.
This is very rough, but should give you an idea:
First, in _ProductVariantAddToCart.cshtml remove the onclick javascript event from the button, so that the button actually posts the form to AddProductVariantToCart in CatalogController. This should remove the AjaxCart.
This will also add the item to the cart and redirect you to the shoppingcart page.
When the ShoppingCart page loads in action Cart. Add the following:
if(_workContext.CurrentCustomer.IsGuest())
return new HttpUnauthorizedResult("Cart requires the user to have an account");
This will send the user to the login page giving the impression that the user needs to login to add items to the cart.
Hope this helps

Related

How to simplify Drupal Commerce checkout process

By default when we are at the cart page and click the button "Checkout", we are redirected to the "Order information" page, then we click "Continue to review" and we are redirected to the "Review" page and then we can click the last button to complete the process and we are redirected to the "Complete" page.
Is it possible and how to simplify the process so that if we click "Checkout" we are redirected to the "Complete" page with automatic choosing only one payment method by default?
I don't see the answer in their docs
Ok, the answer is simple: to disable unnecessary panes in the default checkout flow

Successfully added to cart message needs to show on a specific page

I have created my own menu page and have created a redirect function so that it redirects after the person hits the "add to cart" button, to go back to the our menu page so they can continue shopping. I would like the 'You have added this product to the cart' message to show up on this page after the redirect. I know that I need to add in a function that will either show this message on the page or create one that shows on the page but not sure exactly how to do so. Please help!
The page is https://notjustcurries.ca/our-menu/

GTM trigger not firing on custom pop-up screen

On our site, https://www.nzmotorhomerentals.co.nz/ we have created an tag in our GTM container to track Adwords conversion, however are having issues getting the tag to fire when a user clicks the Confirm button at the end of the booking process. We believe this is due to the pop-up screen once a user clicks on a search result.
At the moment the booking process is as follows:
1. User lands on homepage or other landing page.
2. User enters search criteria, and clicks 'Search'
3. User lands on /results page and then clicks 'Select' on chosen vehicle
4. Pop-up window appears and user clicks 'Go to final step'
5. User lands on final booking page and clicks 'Confirm'. When a user clicks 'Confirm' this is when we want the tag to fire.
We have tried a wide range of trigger variables with no luck. We managed to get a tag to fire on step 1 when a user clicks 'Search' as a way of troubleshooting, however have not been able to get any tags to fire once a user lands on the /results page and further into the booking flow.
All content from /results onward is a custom piece of html that is pulling from a broker site (this website is an affiliate model). We are wondering if Google Manager is able to read this custom code at all.
Any assistance on how variables to set to fire this trigger is much appreciated.
your booking form is implemented in the iframe and is unavailable to Tag Manager.

How do I create a View Cart button in Website Payments Standard?

I'm using Website Payments Standard.
I've created 2 Add to Cart buttons using the manager and they work fine.
If my buyer clicks the Continue Shopping button, he's returned to the catalogue page and can't see the cart.
How do I create a View Cart button, please ?
It doesn't appear in the Button factory.
After you create your Add to Cart button, scroll down past the box where PayPal gives you your HTML code. There's a section that says Create more buttons, and one of the options says Create a View Cart button.

How to add destination page URL in create user wizard button?

I am trying to customize the create user Wizard control in asp. What it does is redirecting me to a continue page after creating the user, but I want a custom page to be displayed after creating a page.... What can I do?
Handle CreatedUser event and then Response.Redirect()
or play with control's properties:
ContinueDestinationPageUrl Gets or sets the URL of the page that the user will see after clicking the Continue button on the success page.
FinishDestinationPageUrl Gets or sets the URL that the user is redirected to when they click the Finish button.

Resources