site link search box shopify - data-structures

I want to include an input box on site A; after I type in the query and press Enter, open a new tab to display the search results of B. It would be as if I had typed the search query into B directly.

Set up a form to handle the search. Make it's action parameter the address of site B's search handler. Give it a target attribute of _blank
e.g.
<form action="https://storeB.myshopify.com/search" method="GET" target="_blank">
<input name="q" type="text">
<input type="submit" value="Submit">
</form>
These are the basics. You can match the look of your current site by adapting the code from your theme. The code to look at may be in your theme's folders under templates/search.liquid.

Related

WIX: Add custom HTML or my own form (to another website)

I need to create a form that by clicking on it will redirect to another website with special 'inputs' tags values.
something like:
<form action="http://example.com" method="post">
<input type="hidden" name="val1" value="something">
<input type="hidden" name="val2" value="else">
<input type="submit" name="submit" value="Go">
</form>
The custom HTML feature that I find will put it inside an iframe, and it looks bad. Is there a way to do it that will look 'normal'?
If you utilize Wix Code you can develop that inside your Wix page without the need of any html forms.
Simple solution:
- Add the form input elements you need on your page
- Add a button to click on
- Add av event handler to the button and grab the values from the input fields
- Send that data to any site or redirect the user to the site you want using wixLocation.to("url") with the query parameters you might need from the form.

Laravel testing form press method doesn't works

I'm trying to cover my project with test and faced with problem.
The "press" method of TestCase fails with 'InvalidArgumentException: Unreachable field ""'
However the "see" method sees the needed button
Besides another form on another page tests fine
Hours of debug show me that the issue might be in the fact that the problem form has multiple (with this brackets []) inputs
Test code that fails
$this->type($params['from'], 'from[]');
$this->type($params['event'], 'event[]');
$this->type($params['class'], 'class[]');
$this->type($params['method'], 'method[]');
$this->press('save_handlers');
With form and button everythings is okey
Button:
<button type="submit" class="btn btn-primary btn-block" name="save_handlers">Save</button>
And of course button is in the form tag
Indeed, the problem is linked with the fact that there are attributes with brackets[].
I just had the same problem. I'm using a form with multiple checkboxes, and all of them have the same name (but different id) : codes[]. I'm doing this in order to retrieve them later (in a controller) simply as an array of values.
<input id="perm-0" type="checkbox" name="codes[]" value="perm-0" />
<input id="perm-1" type="checkbox" name="codes[]" value="perm-1" />
<input id="perm-2" type="checkbox" name="codes[]" value="perm-2" />
My friend var_dump() told me that the Symfony component which parses the form inputs doesn't like it when I'm using codes[] with nothing inside the brackets. It is seen as two fields : "codes" and "" instead of codes[]. That's causing the Unreachable field "" error.
A simple solution I found is to simply add an explicit index for the codes[] array :
<input id="perm-0" type="checkbox" name="codes[0]" value="perm-0" />
<input id="perm-1" type="checkbox" name="codes[1]" value="perm-1" />
<input id="perm-2" type="checkbox" name="codes[2]" value="perm-2" />
This way each checkbox is distinct from others, and the method press() does not cause the error any more.
It seems that this doesn't affect the processing of the resulting array in my controller.
This seems rather confusing seeing as the docs state this:
"Press" a button with the given text or name.
While the docblock above the actual press method states the following:
Submit a form using the button with the given text value.
So instead of using the value of the name attribute (save_handler) use the actual text (Save).
$this->press('Save');

Finding an element by XPath in Selenium

I am trying to use Selenium to navigate a webpage. There is a button I am trying to get to via its xpath. For other buttons on the site, it works fine. But for this particular one, I keep getting the error that the element can't be located. Firebug is just giving me the xpath in this format: //*[#id="continueButton"].
I notice that the button has wrappers around it. They are structured like
<div class = "cButtonWrapper">
<div class = "cButtonHolder">
<input type="image" id="continueButton" name="Continue" alt="Continue" src="/store/images/btn_continue.gif" value="Continue">
</div>
</div>
Could the wrappers around the button have anything to do with not being able to locate it?
Maybe the <input> element cannot be properly located by XPath because you are using invalid HTML. Try using <input id="continueButton"/> or <input id="continueButton"></input> in your page source.

VirtueMart Search Frustrations

I am trying to implement a simple "Virtuemart Only" search in one of the custom modules on a site.
What I'd like is to be able to insert the search tags into an existing table in a mod_custom module. The problem is, I have no idea how to code an <INPUT> tag to work with VM.
Every Google search I've done returns solutions centered on either (1) installing the VM Advanced Search module, (2) using the basic VM Search module, or (3) using Modules Anywhere to load one of the previously mentioned modules into an existing space. Problem is, the site I'm working on doesn't need another module taking up space. It really just needs a simple <INPUT> field in a particular location that sends queries to VM.
Edit: To clarify my purpose, here is a partial of the source code I want to insert the search into:
<table id="product-search" class="product-search">
<tbody>
<tr>
<td></td>
<td><span class="search-title">Order Online</span></td>
</tr>
<tr>
<td><img src="shopping-cart.png" /></td>
<td><**SEARCH CODE HERE**></td>
</tr>
etc... etc...
So you can see, it's just a simple table with some icons, phone numbers, etc., with the search <input> (hopefully) inserted in the middle of it.
I'm guessing I just need to add some stupidly simple code like:
<form action="administrator/components/com_virtuemart/html/shop.search.php" method="get">
Product Search: <input type="text" name="fname" /><input type="submit" value="Submit" />
</form>
Of course, I just get an error trying to directly access that particular script, so I'm wondering: Any VM gurus know how to code this?
You're not going to be able to just insert a tag in to a mod_custom module, that's not how it works. Did you try the VM Advanced Search Module?
http://extensions.joomla.org/extensions/extension-specific/virtuemart-extensions/virtuemart-products-search/8396
This takes the VM Adv search and puts it in a module. It should do what you need.
I managed to figure it out by scouring the page source for sites I know using VM (should have thought of that in the first place). The code is:
<div class="virtuemart_advsearch">
<form name="adv_search" method="post" action="http://www.mywebsite.com">
<input type="hidden" value="shop.browse" name="page"/>
<input type="hidden" value="com_virtuemart" name="option"/>
<input type="hidden" value="9999" name="Itemid"/>
<input type="text" size="20" name="keyword1" class="inputbox"/>
<input type="submit" value="Search" name="search" class="button search"/>
</form>
</div>
The <div> isn't really necessary, but it keeps things neatly divided for now. This is not the cleanest implementation, but it'll do for now.
If you want to search product only in your site then it will be better if you use default product search module in virtue mart. It will work fine.

Submit button to submit a form in dreamweaver cs4

I can not get the form to submit with the button. The best luck I have had is to send a generic email with no data attached.
This is the code:
<input name="mailto: info#thebellimagegroup.com" type="submit" onClick=mailto: info#thebellimagegroup.com value="Submit Form" id="mailto: info#thebellimagegroup.com" >
the value is: /frms/contact.con
Can anyone help????
Submit buttons generally aren't used for storing information -- as a rule, they just submit the page, and any other information (such as the email recipient's address) will be put in other inputs in the form. For example:
<form action="/frms/contact.con" method="post">
<label>Subject: <input type="text" name="subject" value="" /></label>
<label for="message-editor">Message</label>
<textarea name="message" rows="6" cols="60" id="message-editor"></textarea>
<input type="submit" value="Submit" />
<input type="hidden" name="recipient" value="info#thebellimagegroup.com" />
</form>
In this example, the "action" attribute of the FORM element specifies the script on the server which will process the information once someone clicks Submit. The hidden input which I have named "recipient" specifies the email address, and the value of that will be sent in along with the rest of the form when it's submitted. All the submit button itself does is cause the browser to send the finished form off to the server for processing.
Note that the example I've given here probably won't work with your particular script, because the names I've selected for the example inputs ("subject", "message", and "recipient") probably don't match the ones your script expects.
Do you have documentation on how the /frms/contact.con script works? If so, check it -- it should tell you what to name your form elements. Failing that, and assuming that you know whatever programming language it was written in, you could read the code in contact.con to see what names it's expecting.
If all else fails, try a different server-side script, there are about eight zillion available.

Resources