96 lines
		
	
	
		
			3.7 KiB
		
	
	
	
		
			PHTML
		
	
	
		
			Executable File
		
	
	
			
		
		
	
	
			96 lines
		
	
	
		
			3.7 KiB
		
	
	
	
		
			PHTML
		
	
	
		
			Executable File
		
	
	
| <?php
 | |
| /**
 | |
|  * Copyright © Magento, Inc. All rights reserved.
 | |
|  * See COPYING.txt for license details.
 | |
|  */
 | |
| 
 | |
| // @codingStandardsIgnoreFile
 | |
| ?>
 | |
| <?php
 | |
| /** @var $block \Magento\Framework\View\Element\Template */
 | |
| /** @var $helper \Magento\Search\Helper\Data */
 | |
| $helper = $this->helper(\Magento\Search\Helper\Data::class);
 | |
| $objectManager = \Magento\Framework\App\ObjectManager::getInstance();
 | |
| $request = $objectManager->get('\Magento\Framework\App\Request\Http');
 | |
| if ($request->getFullActionName() == 'catalog_category_view') {
 | |
|     ?>
 | |
|     <script>
 | |
|     require(['jquery'], function($) {
 | |
|         $("#maincontent").addClass("page-categories");
 | |
|     });
 | |
|     </script>
 | |
|     <?php
 | |
| }
 | |
| $customerSession = $objectManager->create('Magento\Customer\Model\Session');
 | |
| $email = "";
 | |
| $customer_id = "";
 | |
| if ($customerSession->isLoggedIn()) {
 | |
|     $email = $customerSession->getCustomer()->getEmail();
 | |
|     $customer_id = $customerSession->getCustomer()->getId();
 | |
| }
 | |
| 
 | |
| ?>
 | |
| 
 | |
| <div class="block block-search">
 | |
|     <div class="block block-title"><strong><?= /* @escapeNotVerified */ __('Search') ?></strong></div>
 | |
|     <div class="block block-content">
 | |
|         <form class="form minisearch" id="search_mini_form" action="<?= /* @escapeNotVerified */ $helper->getResultUrl() ?>" method="get">
 | |
|             <div class="field search">
 | |
|                 <label class="label" for="search" data-role="minisearch-label">
 | |
|                     <span><?= /* @escapeNotVerified */ __('Search') ?></span>
 | |
|                 </label>
 | |
|                 <div class="control">
 | |
|                     <input id="search"
 | |
|                            data-mage-init='{"quickSearch":{
 | |
|                                 "formSelector":"#search_mini_form",
 | |
|                                 "url":"<?= /* @escapeNotVerified */ $helper->getSuggestUrl()?>",
 | |
|                                 "destinationSelector":"#search_autocomplete"}
 | |
|                            }'
 | |
|                            type="text"
 | |
|                            name="<?= /* @escapeNotVerified */ $helper->getQueryParamName() ?>"
 | |
|                            value="<?= /* @escapeNotVerified */ $helper->getEscapedQueryText() ?>"
 | |
|                            placeholder="<?= /* @escapeNotVerified */ __('Search entire store here...') ?>"
 | |
|                            class="input-text"
 | |
|                            maxlength="<?= /* @escapeNotVerified */ $helper->getMaxQueryLength() ?>"
 | |
|                            role="combobox"
 | |
|                            aria-haspopup="false"
 | |
|                            aria-autocomplete="both"
 | |
|                            autocomplete="off"/>
 | |
|                     <div id="search_autocomplete" class="search-autocomplete"></div>
 | |
|                     <?= $block->getChildHtml() ?>
 | |
|                 </div>
 | |
|             </div>
 | |
|             <div class="actions">
 | |
|                 <button type="submit"
 | |
|                         title="<?= $block->escapeHtml(__('Search')) ?>"
 | |
|                         class="action search">
 | |
|                     <span><?= /* @escapeNotVerified */ __('Search') ?></span>
 | |
|                 </button>
 | |
|             </div>
 | |
|         </form>
 | |
|     </div>
 | |
| </div>
 | |
| 
 | |
| 
 | |
| <script>
 | |
|     require(['jquery'], function($) {
 | |
|         $( document ).ready(function() {
 | |
|             if ($(".stock.unavailable span").length > 0 ) {
 | |
|                 $(".stock.unavailable span").html("Price on request");
 | |
|                 $(".stock.unavailable").show();
 | |
|             }
 | |
| 
 | |
|             $( document ).ajaxComplete(function( event, xhr, settings ) {
 | |
|                 if (settings.url.includes("mageworx_searchsuiteautocomplete/ajax/index")) {
 | |
|                     $(".qs-option-price .normal-price .price").each(function( index ) {
 | |
|                         $(this).html("From " + $(this).html());
 | |
|                     });
 | |
|                 }
 | |
|             });
 | |
|         });
 | |
|     });
 | |
|     </script>
 | |
| 
 | |
| 
 | |
| 
 |