Button That Opens (switches to) Different Product Detail Tab - Magento - javascript

I am using Magento Community, and there are product detail tabs on each products listing page. I have created a Make Offer form and put this in a product detail tab. I have a "make offer" button right under the "add to cart" button. I want this "make offer" button to have a function that directs the buyer to the Make Offer tab below (which is NOT currently opened to) by scrolling down the page and opening this product tab.
How would I do this?
Please let me know if additional information is needed.
Thanks!

To "direct" the buyer to that specific area in the page you could use an achor pointing to the specific div using the id:
Make Offer
To open the tab you would have to add some JavaScript (either in a .js file included in the page or in a template file). If you know how the tabs js works, you could reuse some code. If not you can trigger the click using jQuery or something similar:
function openMakeOfferTab(){
jQuery(".make-offer-tab").click();
}

Related

How to trigger Elementor Popup based on specific url

I have a one page website with different sections and few simple popup which are triggered when user clicks on link/button on a page. I want same popup to open when user access website with a specific url example
www.example.com/#menu
www.example.com/#privacy-policy
I found setting under Elementor popup when arriving from specific URL but this option is not working for me.
I can do same using custom JavaScript unless it will not work with elementor feature.
I tried different combination of url such as https://www.example.com/#menu #menu https://example.com/#menu
its not working for any combination.
I did keep condition setting also as Entire site etc..
Just need a point as i could not find any specify article regarding this as most of the article are about how to trigger popup from link.
Set a class on the section you want.
Go to Popup triggers
Check "On scroll to element" en put the class in.
Now the pop up show op when you scroll on the section.

Facebook share button current URL

I want to add a share button to my website but notice I have two similar options:
Share button
Share dialog
Are they different and how could I show a share button for the dialog option?
Also, for the button code it says HTML5/data-href "defaults to the current URL" which I want, so would I simply delete data-href from the button code or just leave the URL empty?
Share Button
Social Plugin that comes with a predefined button, you cannot change the appearance. Simple to include.
Share Dialog
Use your own button/link/whatever and call FB.ui to open the Dialog.

is it possible to prevent oracle apex from submitting a page until a user clicks on a refresh button on that page?

I have just started working with Oracle APEX and would like users to be able to download reports from my application.The problem is I have a number of reports which have a large number of rows. Each time a user clicks on a page tab, the page is resubmitted and the query for the reports are executed again. This results in a lot of delay and is becoming frustrating for the users!
Is it possible to stop APEX from resubmitting the page until the user clicks a refresh button or is it possible to stop the query for reports from executing everytime the user clicks on a page tab?
To prevent submitting you can change the page template. Open page properties, in the section Shared Components find Templates. Near the word Page you will see a link to its template. Follow this link, then find a section Standard Tab Attributes. In the field Current Tab you will see something like this:
<li>#TAB_LABEL##TAB_INLINE_EDIT#</li>
Change this value to:
<li><a class="active">#TAB_LABEL#</a>#TAB_INLINE_EDIT#</li>
After that an active item in a menu will be displayed as a static text, not as a link.
All pages with this page template will have this behavior. If you don't need to change behavior of all pages: before changing template make copy of it, change the copy and choose the new template in a page properties.
Have you tried with the conditions?? I pretty new with Apex too, I had a similar problem, what I did was put conditions to the buttoms and regions.
After that I good a nice result. Hope it helps you.
Good luck

Launch browser popup and POST to a different site

I have two websites (ASP.NET MVC 3, but I don't think that's very important). The first one has a button; when the user clicks that button, the site needs to make a POST call to the second website and display the result in a popup. The result is a wizard of sorts - it has several steps that require clicking buttons. The final step should close the popup.
My main problem is: how can I make the popup AND the POST? I can do a POST from the code-behind in my first site, but if I just display the resulting HTML in the popup window (replacing its content or something), the browser still knows that the page came from the first site, so the next button click tries to go to the first site. I need the popup to know its contents came from the second site.
Is this possible?
View Site A in browser. POST to Site B. Site B sends minimal HTML to browser, and that HTML creates the popup.
Does that help? Can clarify further if needed.

Open redirect page in new tab and reopen in the same tab on multiple redirects Django

I am making a blog app in Django and I want to do the following things
When the user submits the preview button I want to open the partially completed blog in a new tab in the same window.
Secondly if the user does not close the tab and again presses preview button, I want to display the updated blog in the tab which was previously opened.
How can I do this?
Edit:
As told in the answer below I am trying to use this code snippet to open it in a new window, but this does not work
<script>
var current_link = $(location).attr('href');
$('.preview_button').onClick(function() {
window.open(current_link,'preview_tab');
});
</script>
Also I currently have 3 submit buttons and I want to provide this feature only for 1 submit button i.e. preview So I cannot directly do (#form).onSubmit. For the the other two buttons, one updates the content via Ajax and the other redirects to a new page.
Try using a Javascript onSubmit to open the appropriate preview page with window.open, passing a name as the second parameter. It does almost exactly that. (If you want to support having different preview tabs associated with different editing tabs, include something in the name based on a tab ID of some kind -- maybe the article ID plus a random number, or something.)
You'll have to also send the updated content into the server via AJAX.

Categories