Joomla 3.8 Administration - direct link to to enable/disable module - joomla

I have googled bud did not found answer.
Howto in joomla Administration create a button do Enable/disable any module to show/hide on frontend?
eg. I'm in restaurant component and I need to use 2-3 buttons to change delivery time in frontend. e. 30 minutes, 60 minutes etc. I will create 2-3 different modules with own text and I need to show/hide them directly form my restaurant component using one click button in this component.
Thank you in advance.

I assume you are on the front-end of the website, logged in, and on a restaurant component page. You have different modules that reveal text ie. 30 min, 60 min.
Your challenge is that it takes too long to open each module and enable/disable when you are busy filling orders.
Option #1:
I would have someone write a plugin that ties together all delivery modules. Use a dropdown menu (30 min, 60 min, etc.) so that you can turn on what you need quickly. A button would require an additional step because you would click on it, another screen would open up, then you pick the module to show.
Option #2
Try installing "Modules Anywhere" from Regular Labs. It's free and just may do the trick. After a quick install and set-up, you basically use a shortcode containing the name of module to show up.
Just create a single (Custom HTML) module, put it on the front end at your restaurant module and use the shortcode below to point from 30 minutes to 60 minutes, etc. Be sure that all of your delivery modules are published; make the module names easy (ie. 30min).
{module Name of My Module}
{module 30min}
Quickly changes to {module 60min}
It's not a button, but it's quick enough to do the job.
https://www.regularlabs.com/extensions/modulesanywhere
Good luck!

Related

detect if site is being accessed via iframe? embed widget with shopping cart

I have a shopping cart I want to embed in a widget/iframe on other users sites, I see three ways of doing this each with drawbacks. Here are options from estimated most to least work.
Recreate interactive shopping cart UI in javascript widget then pass values to server script with AJAX, variables are passed to the main site, when user clicks "checkout" the user is then redirected to main shopping cart site with variables populated from what the entered in the widget.
pros: complete experience
cons: most work to complete creating UI and AJAX request.
Somehow detect if user is coming to shopping cart via iframe, if this is the case have alternate code that opens new window when user clicks "checkout" redirecting user to secure page and getting variables from cart via AJAX to populate final checkout.
pros: mid amount of work, must do AJAX request to get variables from shopping cart to populate final checkout
cons: can we easily detect if site is being accessed from a user within an iframe on another site?
complete entire checkout process inside iframe/widget.
pros: least ammount of work, just embed cart in iframe
cons: will not show https in browser user may be reluctant to purchase
What is the best option?
If you could provide a bit more information, maybe I could offer you an even better option. For starters, what have you built this application with (languages/framework)? Also, would you say your application's functionality is similar to Shopify's in that you allow users to host e-commerce sites through your service? If not, tell us a bit more about your application.
Here's a quick response to the options you provided.
option 1: the only real option as I see it. Whether you're embedding the shopping cart in specifically an iframe or rendering it onto the user's page as part of a template, you should be navigating the customer away to your main site to complete the checkout process. Or at least give them a lot of screen real-estate to work with (a sizable modal for example).
option 2: is messy. You can tell if a request is coming from a remote form (like an iframe) by appending url parameters. But taking the approach you're suggesting with this doesn't make too much sense.
option 3: too heavy unless you take a modal-approach like what I mentioned in response to option 1.
That being said, if you are building an application like Shopify, you should be able to build a template for each user's website that has a section dedicated to displaying a shopping cart pertaining to the current customer's session. No iframes or widgets necessary with this approach. But again, it all depends on the use cases of your application.
If your only concern with Option 2 is detecting if your content is being loaded within an iframe, you can do that with JavaScript by using "top.frames.length" or "top === self."
For example, you could show or hide different conditional form content, or a different submit button, using the following:
if (top.frames.length == 0) {
// Show content if not embedded in an iframe.
document.getElementById('embedded-content').style.display = "none";
document.getElementById('unembedded-content').style.display = "block";
}
else {
// Show content if embedded in an iframe.
document.getElementById('embedded-content').style.display = "block";
document.getElementById('unembedded-content').style.display = "none";
}
As you've stated, the first option is the best in terms of user experience and the most likely to achieve the highest possible conversions. How much better the conversion is compared to the next best solution cannot be objectively measured, as it involves recurring customers, your own brand name, the kind of products, etc. Since the conversion rates will directly affect you (and your company), it's wise to make an estimate first to see if your efforts spent will be worth it in the short and long term.
The second option is the sweet middle ground; you still get brand recognition and customers will have some security reassurance (via address bar); (i)frame detection is easily done by a simple JavaScript comparison: top === window. However, you're losing the continuity and hence likely lose some conversion. If this risk is manageable, I'd go for this option in the short term.
Not being able to see the security certificate directly via the green lock makes the third option the least desirable. However, not all is lost; by clever use of imagery you can still gain some trust with your end-user, as outlined in this image, which is part of a great article from Smashing Magazine.
Your decision should be based on:
what can be done in the short term
what should be done in the long term
how important is secure visual cues to my potential customer
time / money spent on either solution versus revenues (break-even analysis)

Drupal 7 - Views, loaded by Ajax

Two years ago I made a website to learn Flash, but these days Flash is loosing it's popularity. (the website never went online, was just for testing) Now I want to try making this test website with Drupal + Ajax...
Take a look at the Flash website
I have a collection of handbags, with different types and sizes. So I use taxonomy for that. (content type: handbag, with taxonomy terms "type" and "size" - small, medium and large)
The visitor should choose a type in the navigation. (Silver Medallion or Silver Jewel) Then he sees a page (made with views) that shows all available sizes. (The type 'Jewel' doesn't have sizes, so this type should show all bags.)
After the visitor clicks a size, he sees all available items of that type and size. With views, this is quite simple... But now I want to do this with Ajax, so the page doesn't have to reload... I also want the path to change, so people can add a page to the favortites.
I found an answer that helped me a bit further, but I have no idea where to put the code...
Code that helped me out... a bit
I think you need to create a custom module to create the view and add the configuration in setting file, then create a js file and add to drupal project.
Take a look at this. It seems to provide what you want: http://drupal.org/project/quicktabs/

Event tracking and virtual pageviews are not tracked in Google Analytics

I'm trying to track how visitors interact with the price calculator that i placed on my website.
I've tried placing events and virtual pageviews in different places and events (onClick, onMouseDown, onMouseOver, in href attribute, onChange in the input tag). No matter what i do - no events or virtual pageviews are tracked, though i can see the __utm.gif requests for everything i want to track in FireBug, but nothing in GA reports.
Here's the calculator i'm tracking (it's in Russian, the event i'm trying to track is the big orange button).
Firstly, I do see a _trackPageview() call passing "/virtual/trees/calculate" on various onmouseover,onchange, and onclicks, and at face value I see no reason you shouldn't be seeing "/virtual/trees/calculate" show up in your pages report, but google officially states that it takes up to 24 hours to see data.
Second, I do not see any event tracking on your page. I do not see any code for it, nor do I see any GA calls showing it from random interactions on your page. If it is there, you will need to give detail about where it is and how it is coded.
Third, do you see the page view for the actual page? Which account/profile are you looking at? Because when I first load the page, I see two separate hits to GA happening, the first to account/profile # "UA-25026876-1" (which is from your on-page code) and the second to account/profile # "UA-20200270-1" (which is happening from a counter.js script include), and the second one is where your virtual page views are going to.

Joomla 1.5 / Modification of YooTheme "ZOO" Component

I'll start out by mentioning that there is a developer forum for Zoo and I have used it already. My purpose posting here is that I typically get a thorough answer within minutes or hours at SO, whereas the responses on dev forums can be slow or non-existent due to the smaller population base.
My question regards Yootheme's ZOO 2.3.2. By default, a product "Frontpage" appears to have a "Categories" box rendered on top of the items. If one turns off all the available options in Frontpage/Template configuration (hide Titles, Count, Descriptions, etc.), an empty box still remains on top of the items.
I've been able to manually remove the box in its entirety by addressing the following file:
media/zoo/applications/product/templates/default/frontpage.php, and commenting out lines 84-92:
<!-- <?php
// render categories
if ($this->category->childrenHaveItems()) {
$categoriestitle = $this->application->getParams()->get('content.categories_title');
echo $this->partial('categories', compact('categoriestitle'));
}
?> -->
Seems like there should be a more eloquent way of doing this on the admin backend, but I couldn't find one. Am I missing something or is my solution the best one?
ZOO is designed to easily be able to modify the built in templates to suit your needs. ZOO templates are meant to be overridden much like Joomla uses template overrides. Rather than editing the default template, you simply create a new template that does what you want it to. The default template should not be changed.
Here is the documentation on ZOO templates - http://www.yootheme.com/docs/home/item/create-a-new-template
Rather than edit the file you mention above, you make a new template here -
media/zoo/applications/product/templates/YOUR-TEMPLATE-NAME/frontpage.php
Then do all the changing you want without messing up the default.
There is an easier way: First, you must identify what calls the item called "frontpage". In PURE yootheme at least it is called from "home" in the "mainmenu". So click "home" buton of the mainmenu, then over the right menu "Parameters(Basic)" you just chose "-select aplication-" instead "frontpage" and that's it.The Frontpage and its "box" are now gone. At least it works for me.

Online Advetisement/Banner Management System

I am developing site for online advertisements where sellers and buyers can come and sell/buy advertisements.
Just need to develop detailed statistics like click counts, from which page clicks are coming (one advertisement can be placed on many pages), from which position (top, right, left ...) click are coming (one advertisement can be placed in different position on single page) etc. I seen that most of the advertisement on popular websites has following format:
http://ads.stackoverflow.com/a.aspx?Task=Click&ZoneID=3&CampaignID=838&AdvertiserID=50&BannerID=1335&SiteID=1&RandomNumber=1463177307&Keywords=c%23%2c.net%2ccollections%2cdictionary%2chashtable
It has many parameters like ZoneID, CampaignID, AdvertiserID, BannerID, SiteID, RandomNumber, adid, adcrid, obid, obtid and way. I can use one advertisement (adid) in multiple pages. But can't figure out the way to distinguish between from which pages clicks are coming. How can I use such parameters to generate statistics which tell me the page from which clicks are coming?
I'm curious as to why you would want to reinvent this wheel?

Resources