Celebrate National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

How do I modify Joomla component to remove a line on the displayed form?

Posted on 2014-11-17
14
Medium Priority
?
114 Views
Last Modified: 2014-11-19
Here is the url.

http://domgarofalo.com/collegekids

username: Expert
password: Windows1

I need size " infant 0-3" taken off ONLY the following:

- ruffle tee
- short sleeve tee
- girlie tee
- crew
- zip hood
- varsity cardi
- sweat pant

After you login, click Place Order, click Add Items, and click Infant.
There are 4 MVP body suits to choose from. I want to remove the
size 0-3 on each one.

I can't get a hold of the creator of the component and I have
checked all the documentation to no avail. The name of the
component is JoomeSuite. If you need ftp access, let me know.
This is not the actual site, it is a demo. Once I find the solution, I
will apply it to the actual site.

Thank you.
0
Comment
Question by:domgarofalo
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 8
  • 6
14 Comments
 
LVL 14

Expert Comment

by:CtrlAltDl
ID: 40447864
I know you could hide the infant selections with:
$('[id=infant]').hide();

Still looking into how to determine which items to hide it for...
0
 
LVL 14

Expert Comment

by:CtrlAltDl
ID: 40447867
Instead of hiding "infant" wouldn't we just want to hide those items after Infant has been selected?
0
 
LVL 14

Expert Comment

by:CtrlAltDl
ID: 40447926
Is the Image "alt" the unique product ID?  If so it looks like that would be the best thing to use for a selector.
//Check if infant has been selected.
if ($('#infant').is(":visible") )
{
     //Hide the Ruffle Tee (Product ID: 14321)
     $('img[alt="14321"]').hide();
}

Open in new window

0
Why Off-Site Backups Are The Only Way To Go

You are probably backing up your data—but how and where? Ransomware is on the rise and there are variants that specifically target backups. Read on to discover why off-site is the way to go.

 

Author Comment

by:domgarofalo
ID: 40447949
If you go to the order form. There is a paragraph on top that say which items are not available in that size anymore. I think the alt is the unique product ID. We could hide it that way then?
0
 
LVL 14

Expert Comment

by:CtrlAltDl
ID: 40447988
Yup, you can hide an image with the alt tag (see my code above).

FYI, if you search with nothing the textbox the error has a misspelling for "search" ("Please enter a name to serach for.").
0
 
LVL 14

Accepted Solution

by:
CtrlAltDl earned 2000 total points
ID: 40448015
Now the trick is to have it hide those elements when the Infant items are shown.

This code must run when the page is loaded.
//Trigger the infantSelected() function when infant is selected
$('#infant').bind('isVisible', infantSelected);

Open in new window


This function is called when infant is selected.
function infantSelected()
{
     //Hide the Ruffle Tee (Product ID: 14321)
     $('img[alt="14321"]').hide();
     //Hide the Short Sleeve Tee (Product ID: 10801)
     $('img[alt="10801"]').hide();
     //Add the rest of the items below.
}

Open in new window

0
 

Author Comment

by:domgarofalo
ID: 40449005
Not to sound like a total newb, but which file do I add this to? Is this part of the php or JQuery? Thanks!
0
 

Author Comment

by:domgarofalo
ID: 40450276
I can give you access to the files if you need it.
0
 
LVL 14

Expert Comment

by:CtrlAltDl
ID: 40451060
That code needs to be added inside of the php file within a script tag.  Preferably within an existing one.
<script>
function infantSelected()
{
     //Hide the Ruffle Tee (Product ID: 14321)
     $('img[alt="14321"]').hide();
     //Hide the Short Sleeve Tee (Product ID: 10801)
     $('img[alt="10801"]').hide();
     //Add the rest of the items below.
}
</script>

Open in new window


And this jQuery code should be added to the jquery $(document).ready() function, which appears to be within the joomsuite add-on.

		$(document).ready(function() {
			if(type == "Customer"){
				selectCustomer("E1278 Wesley J Cuebas");
			}
			
			//Check if infant has been selected.
			if ($('#infant').is(":visible") )
			{
			     //Hide the Ruffle Tee (Product ID: 14321)
			     $('img[alt="14321"]').hide();
			}
		});

Open in new window

0
 

Author Comment

by:domgarofalo
ID: 40452379
I'm trying to find where to add the second part and I can't seem to find it.
0
 
LVL 14

Expert Comment

by:CtrlAltDl
ID: 40452744
Do you have a text editor (I use Notepad++) or IDE (Visual Studio, etc.) that can search a whole subdirectory for text?  If so you can do a search for $(document).ready.
0
 

Author Comment

by:domgarofalo
ID: 40452931
I was able to find it by opening all of the .js files in the component folder and searching for the string. I don't think I placed the code in the correct spots through. Could you check. Here is the admin access to the site. The site is in the collegekids folder.

http://domgarofalo.com/collegekids/administrator

admin
Windows1

There is an ftp component called eXtplorer under the Extend menu that will give you access to the files.

This is a test site so you don't need to worry about being in there. I added the first block of code to the following file starting at line 34.

components-->com_joomsuite-->views-->placeorder-->tmpl-->default.php

I added the second block of code to the following files starting at line 33.

components-->com_joomsuite-->assets-->js-->place_order.js.php

Thanks for the help.
0
 
LVL 14

Expert Comment

by:CtrlAltDl
ID: 40453109
Ok, I removed the code from tmpl->default.php, and just added everything to the place_order.js.php.

Then I just added the code to hide those items in the $('#infant').click() event starting on Line 111.
0
 

Author Comment

by:domgarofalo
ID: 40453244
You are awesome! Thank you!
0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Build an array called $myWeek which will hold the array elements Today, Yesterday and then builds up the rest of the week by the name of the day going back 1 week.   (CODE) (CODE) Then you just need to pass your date to the function. If i…
Since pre-biblical times, humans have sought ways to keep secrets, and share the secrets selectively.  This article explores the ways PHP can be used to hide and encrypt information.
The viewer will learn how to create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…
Learn how to create flexible layouts using relative units in CSS.  New relative units added in CSS3 include vw(viewports width), vh(viewports height), vmin(minimum of viewports height and width), and vmax (maximum of viewports height and width).
Suggested Courses

730 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question