Bigcommerce Add To Cart Pop-Up - bigcommerce

When using bigcommerce before, we were able to choose whether or not to have a pop up or take the user to the cart whenever they clicked the "Add to Cart" button. Does anybody know if this feature has been taken out by BigCommerce or where I can find that setting now? Thank you!

Do you know if you're using the Stencil or Blueprint framework?
If you're using blueprint, you can go to "Store Setup > Store Settings > Display" and choose "Take Them to Their Shopping Cart".
If you're using stencil, that feature is hidden and you have to do customization for it to work. If your products don't have any options, you can follow the instructions on this page: https://support.bigcommerce.com/articles/Public/How-can-I-add-a-product-to-the-cart-with-a-link/#add-to-cart.
However, if you have options, this won't work because it doesn't updated the sku in the url. What i did to get this to work was to edit the product-details.js
First you need to download the theme in order to edit the js file. Then, starting on line 234, you'll see the following code:
// Open preview modal and update content
if (this.previewModal) {
this.previewModal.open();
this.updateCartContent(this.previewModal, response.data.cart_item.hash);
} else {
this.$overlay.show();
// if no modal, redirect to the cart page
this.redirectTo(response.data.cart_item.cart_url || this.context.urls.cart);
}
Directly under the comment, add /* and then go down one line under the closing brace of the else statement (}) and add */ to close the long comment. The code will now look like this:
// Open preview modal and update content
/*
if (this.previewModal) {
this.previewModal.open();
this.updateCartContent(this.previewModal, response.data.cart_item.hash);
} else {
this.$overlay.show();
// if no modal, redirect to the cart page
this.redirectTo(response.data.cart_item.cart_url || this.context.urls.cart);
}
*/
this.redirectTo(response.data.cart_item.cart_url || this.context.urls.cart);
Let me know if this helps!

Just FYI I went through a similar problem and found that the "Ask a Design partner" forum gave me my answer. The answer I used was from this post:
https://support.bigcommerce.com/s/group/0F913000000HLpWCAW/ask-a-design-partner
But to help I will pull out what they said:
"If you want to remove the popup, you will need to edit the theme files, navigate to the templates/components/products/product-view.html file, and comment out (or remove )this code at the bottom of the file:
<div id="previewModal" class="modal modal--large" data-reveal>
<a href="#" class="modal-close" aria-label="{{lang 'common.close'}}" role="button">
<span aria-hidden="true">×</span>
</a>
<div class="modal-content"></div>
<div class="loadingOverlay"></div>
</div>

Hi You need to do this :
1. Login to admin-end then go to store setting
2. From top tabs choose display tab
3. Find the 'Add to Cart' Action choose what you want pop window or redirection to the cart page.
4. hit the save button.
Check image:
Thanks

Related

Pass data to another element and be able to edit it

Whenever I click on the edit button, I have a textarea which I want to update the value above, however I have an issue to get the text from above to be displayed in the textarea.
enter image description here
I tried solving this like this, but doesn't seem to work. Can someone advice?
<p> {{ points.singlePoint?.description }}</p>
Edit icon here.
<textarea>
placeholder="Add chapter description...",
v-model="newDescriptionData",
v-if="updateDescriptionWindow == true"
</textarea>
const newDescriptionData = ref(points.singlePoint.description)
return {
points,
newDescriptionData
}
Please take a look at an official guide, it might help
Vue.js guide

How to keyboard navigate to reCAPTCHA in a modal dialog?

I need to open Google's latest reCAPTCHA widget in a popup (modal) dialog, a Dojo Dialog in my case, and I've got that working fine, but I just realized that the user cannot keyboard navigate to it.
When the reCAPTCHA widget is displayed in the main view, not a modal dialog, then of course the user can easily keyboard navigate to it.
Has anyone found a way to set focus on the reCAPTCHA widget so that the user can access it without a mouse when the reCAPTCHA is in a Dojo Dialog?
I did see that reCAPTCHA is generated within an <iframe>. Is that part of the hurdle - that keyboard navigation can't reach content within an iframe? I've even tried to call document.getElementById("recaptcha-anchor") since I saw that that's the id of the <span> that holds the "checkbox" - but that is returning null. How to reach an element within an iframe?
I have a jsfiddle example available for demonstration at
https://jsfiddle.net/gregorco/xqs8w5pm/5/
<script>
var onloadCaptchaCallback = function() {
console.log("jsfiddle: rendering captcha");
globalRecaptchaWidgetId = grecaptcha.render('captchaDiv', {
'sitekey' : '6LcgSAMTAAAAACc2C7rc6HB9ZmEX4SyB0bbAJvTG',
'callback' : verifyCaptchaCallback,
'tabindex' : 2
});
grecaptcha.reset();
}
var verifyCaptchaCallback = function(g_recaptcha_response) {
console.log("Response validated. Not a robot.");
};
</script>
<script src='https://www.google.com/recaptcha/api.js?onload=onloadCaptchaCallback&render=explicit' async defer></script>
<div id="testDiv">
<button type="dojo/form/Button" onClick="captchaPopup.show();">Open reCAPTCHA</button>
</div>
<div data-dojo-type="dijit/Dialog" data-dojo-id="captchaPopup" title="Human Verification" style="width:350px;">
Cannot keyboard navigate to the checkbox!
<table>
<tr>
<td>
<div id="captchaDiv"></div><br/>
</td>
</tr>
</table>
</div>
Give this fiddle a try. Normally Dijit dialogs don't work too well with iframes in them because it doesn't know how to parse the content inside an iframe. In this case, we can use some of Dojo's functions to work around it. One notable thing to point out is that I've disabled autofocus of the Dijit Dialog so that it won't automatically focus the closeNode inside the dialog.
After the dialog loads, tab>space will select the captcha.
This may help others facing similar issue, but with Bootstrap modal dialog. I found the following solution on GitHub. Add the following Javascript to override Bootstrap:
Bootstrap 3x
$.fn.modal.Constructor.prototype.enforceFocus = function () { };
Bootstrap 4x
$.fn.modal.Constructor.prototype._enforceFocus = function () { };

durandaljs 2.0 navigation

I have a view with pagination. When the user clicks on a page number, I display the data for that page.
I only want the data items to be replaced so I don't want to navigate to the "next page." So what I'm doing is using the router.navigate(url, { replace: false, trigger: false }); to add the page to the browser's history, but not to trigger the navigate there.
If after I get the data, I click on the browser's back button, the URL changes to the previous one, but I don't get an event. If once I'm back in the previous page, I click the browser's forward button, I get the trigger event from that page.
Example. I'm at /# and it is displaying page 1 of the data. The user click on the "next page" link on the page. I display page 2's data, and I replace the url with /#welcome/2 Now if I click on the browser's back button the URL changes back to /# but the page doesn't trigger. If I press the browser's forward button the URL changes back to /#welcome/2 and the page triggers. Now that that has happened, I can click the back button and page one will trigger; and I can go back and forth between page 1 and page 2. If the user clicks on "page 3", the problem happens again.
If you all need a working example, I will deploy it, but currently this is only running on my local box.
IMO paging, like sorting/filtering represent the internal state of a view/widget and shouldn't be presented via routes. Consider e.g. user is on #something/3 and bookmarks the url. After deleting a couple of items there's no #something/3 any longer and the bookmark fails. Here's some more thought food on that topic http://lostechies.com/derickbailey/2011/08/03/stop-using-backbone-as-if-it-were-a-stateless-web-server/
Update based on comments:
activate on hitting browser back get's not called for two reason. a) welcome.js returns a singleton and b) in shell.html viewCache is set to true. When the user press browser forward it get's called because at this time route #welcome/2 from the SPA perspective is called the first time, so activate kicks in.
One way to make the system work would be to force every page change (regardless if it was initialized by SPA or browser) running through activate. Here are the required steps: Convert the singleton into a constructor, set cacheViews: false and replace click events by normal hrefs that calls the page route.
Update 2
Here's an example that combines the inPage navigation (without router involvement) with the ability to use browser back/forth navigation. init is responsible for setting up things that are common for activate and gotoPage.
Viewmodel
define(['plugins/router', 'knockout'], function( router, ko ) {
var ctor = function() {
this.pageNo = ko.observable();
this.pageData = ko.observable();
};
ctor.prototype.activate = function( page ) {
this.init(page);
};
ctor.prototype.init = function( page ) {
this.pageNo(page || 1);
this.pageData('Data for ' + this.pageNo());
};
ctor.prototype.gotoPage = function( page ) {
var url = "extras/welcome/" + page;
this.init(page);
router.navigate(url, { replace: false, trigger: false });
};
return ctor;
});
View
<section>
<h1>
Hello Durandal Pagination
</h1>
<a data-bind="click: gotoPage.bind($data, 1)" style="cursor: pointer;">Page 1</a>
<a data-bind="click: gotoPage.bind($data, 2)" style="cursor: pointer;">Page 2</a>
<a data-bind="click: gotoPage.bind($data, 3)" style="cursor: pointer;">Page 3</a>
<h2 data-bind="text: pageData"></h2>
</section>
Live example at: http://dfiddle.github.io/dFiddle-2.0/#extras/welcome

I want a 'Text Field' in a folder that is within a document library - Sharepoint 2010

I am rather new to sharepoint and have been lucky enough to find the answer to all my questions with research. I have no found the answer to this question yet.... How do I add a text field WITHIN a folder that is WITHIN a document library. Example: I want to put instructions for upload within a specific folder. I tried to to the 'edit page' --> add text, but the text shows up at the top of ALL folders within that library and I just want it in one. Thank you for your assistance!
Kind regards,
Lanie
You can manage visibility of your message using JavaScript as below.
Don't directly add your message in text field; instead click of the text field you have added, and click "Edit HTML Source" in ribbon bar as highlighted in below image.
Then paste below code in newly opened window:
(Don't forget to replace "Your Message" and "FolderNameInWhichMessageToBeShown" in below code)
<div id="MyCustomMessage">
Your Message
</div>
<script type="text/javascript">
if(decodeURIComponent(document.URL).indexOf('FolderNameInWhichMessageToBeShown') == -1)
{
document.getElementById('MyCustomMessage').style.display = 'none'
}
else
{
document.getElementById('MyCustomMessage').style.display = 'block'
}
</script>
Click "OK" and Save your page.

Colorbox: pop-up image with link to external site on click

I hope someone can help me. I have colorbox working on a new client site, but I'm having troubles figuring out how to add code that will allow for the image that pops up to be clicked and then linked to an external site in a new tab.
This is what I have so far:
$(document).ready(function(){
$("a[rel='pop']").colorbox({transition:"fade", speed: 250});
});
<span class="h2">Baby Knits Kit</span> (2007)<br>Chronicle Books<br>
In the above, when Baby Knits Kit is clicked a pop-up opens fine with the image I created (about.babyknitskit.png). On top of the pop-up there's "Get it at Chronicle Books" and when I click it will take me to that site (in the same tab which I don't want). Instead, I would like the about.babyknitskit.png image to be clickable and opening up the link in a new window.
Any thoughts much appreciated. I hope I've given you guys enough information as I'm new to all of this and stackoverflow.
Simply use the html property of colorbox. Alternatively you could use the href property with 'inline' set to true. I have defined a custom attribute for the anchor for easier extraction, alternatively you could write a regex pattern to extract it from the title attribute.
$(document).ready(function() {
$("a[rel='pop']").colorbox({transition:"fade", speed: 250, html: function(){
var html = $('<img src="' + $(this).attr('href') + '" />');
return html;
}});
});
<span class="h2">Baby Knits Kit</span> (2007)<br>Chronicle Books<br>