Results 1 to 10 of 2247

Hybrid View

  1. #1
    Join Date
    Dec 2009
    Location
    Amersfoort, The Netherlands
    Posts
    2,845
    Plugin Contributions
    25

    Default Re: MultiSite Module Support Forum

    Quote Originally Posted by lat9 View Post
    Thanks, as always, for the quick response. I believe, and will know real-soon-now, that the session issue has to do with the site's setting for "Add period prefix" as the two sites are https://example.com and https://subdomain.example.com.
    I must admit I never really used this function, and the code was already there when I took over management of the module.

    FWY I am considering releasing my commercial Multi Store module as a free mod. This mod has many more possibilities, but is radical different in coding.

  2. #2
    Join Date
    Jan 2007
    Location
    Illinois, USA
    Posts
    329
    Plugin Contributions
    0

    Default Re: MultiSite Module Support Forum

    @Design75 , your mod is great. But I have a list of fixes that needs to be addressed from your upgrade.
    If you need me to resend the list, let me know.
    If you are unable to get to the list, let me know.
    If you have a suggestion of who can can complete your project, let me know.
    It’s been a pleasure to work with you, but due to the php version not being addressed, I lost access to front side of the website due to a continuous out of resources error.
    NTO: building a better network thru collaboration
    www.needtoorder.com | www.coffeewitheinstein.com

  3. #3
    Join Date
    Jan 2007
    Location
    Illinois, USA
    Posts
    329
    Plugin Contributions
    0

    Default Re: MultiSite Module Support Forum

    Wanted to post an update! Design75 has been working out my sites bugs with the multistore mod... and is saving my business! Thank you!
    So much easier to maintain all stores in one place!
    NTO: building a better network thru collaboration
    www.needtoorder.com | www.coffeewitheinstein.com

  4. #4
    Join Date
    Feb 2011
    Posts
    57
    Plugin Contributions
    0

    Default Re: MultiSite Module Support Forum

    Hey this mod is working great for me, I am just having trouble applying
    Code:
    (cat_filter)
    to the instant search box. I searched here to no avail, but the thread is quite large and terms quite vague. Here is my templates instant search box. Inserting (cat_filter ) in various places just seems to disable the instant search box from working. Which I will end up doing if I cannot figure this out, but it is a nice feature that I would prefer not to give up. Many thanks in advance.

    Code:
    <?php
    /**
     * @package Instant Search Results
     * @copyright Copyright Ayoob G 2009-2011
     * @copyright Portions Copyright 2003-2006 The Zen Cart Team
     * @copyright Portions Copyright 2003 osCommerce
     * @license http://www.zen-cart.com/license/2_0.txt GNU Public License V2.0
     */
    
    
    //This PHP file is used to get the search results from our database. 
    
    // I don't know if this is nessceary
    header( 'Content-type: text/html; charset=utf-8' );
    
    
    //need to add this
    require('includes/application_top.php');
    global $db;
    
    
    //this gets the word we are searching for. Usually from instantSearch.js.
    $wordSearch = (isset($_GET['query']) ? $_GET['query'] : '');
    
    // we place or results into these arrays
    //$results will hold data that has the search term in the begining of the word. This will yield a better search result but the number of results will be a few.
    //$resultsAddAfter will hold data that has the search term anywhere in the word. This will yield a normal search result but the number of results will be a high.
    //$results has first priority over $resultsAddAfter
    $results=array();
    $resultsAddAfter=array();
    $prodResult;
    
    
    //the search word can not be empty
    if (strlen($wordSearch) > 0) {
    	
    	//if the user enters less than 2 characters we would like match search results that beging with these characters
    	//if the characters are greater than 2 then we would like to broaden our search results
    	if (strlen($wordSearch) <= 2) {
    		$wordSearchPlus =  $wordSearch . "%";
    	}else{
    		$wordSearchPlus =  "%" . $wordSearch . "%";
    	}
    	
    	
    	//first we would like to search for products that match our search word
    	//we then order the search results with respect to the keyword found at the begining of each of the results
    	$sqlProduct = "SELECT pd.products_name, p.products_model, pd.products_id, p.products_image, p.products_tax_class_id, p.products_price, p.products_status FROM " . TABLE_PRODUCTS_DESCRIPTION . " as pd , " . TABLE_PRODUCTS . " as p
    		WHERE p.products_id = pd.products_id
    			AND p.products_status <> 0
    			AND ((pd.products_name LIKE :wordSearchPlus:) OR (p.products_model LIKE :wordSearchPlus:)  OR (LEFT(pd.products_name,LENGTH(:wordSearch:)) SOUNDS LIKE :wordSearch:))
    			AND language_id = '" . (int)$_SESSION['languages_id'] . "'
    		ORDER BY 
    			field(LEFT(pd.products_name,LENGTH(:wordSearch:)), :wordSearch:) DESC,
    			pd.products_viewed DESC";
    						
    	//this protects use from sql injection - i think????
    	$sqlProduct = $db->bindVars($sqlProduct, ':wordSearch:', $wordSearch, 'string');
    	$sqlProduct = $db->bindVars($sqlProduct, ':wordSearchPlus:', $wordSearchPlus, 'string');
    
    
    	$dbProducts = $db->Execute($sqlProduct);
    	
    	
    	//this takes each item that was found in the results and places it into 2 separate arrays
    	if ($dbProducts->RecordCount() > 0) {
    	  while (!$dbProducts->EOF) {
    		$prodResult = strip_tags($dbProducts->fields['products_name']);
    		$products_model = $dbProducts->fields['products_model'];
    		
    		if (strtolower(substr($prodResult,0,strlen($wordSearch))) == strtolower($wordSearch)){
    			$results[] = array(
    				//we have 4 seperate variables that will be passed on to instantSearch.js
    				//'q' is the result thats been found
    				//'c' is the number of item within a category search (we leave this empty for product search, look at the example bellow for category search)
    				//'l' is used for creating a link to the product or category
    				//'pc' lets us know if the word found is a product or a category
    				//'pr' for the price of product
    				//'img' gets the image of product/category
    				'q'=>$prodResult,
    				'c'=>zen_get_products_display_price($dbProducts->fields['products_id']),
    				'l'=>$dbProducts->fields['products_id'],
    				'pc'=>"p",
    				'pr'=>"",
    				'pm'=> (($products_model !='') ? '<span class="product-model">'.TEXT_PRODUCT_MODEL . '<strong>'.$products_model.'</strong></span>' : ''),
    				'img'=>zen_image(DIR_WS_IMAGES . strip_tags($dbProducts->fields['products_image']), strip_tags($dbProducts->fields['products_name']), 85, 106)
    			);
    		}else{
    			$resultsAddAfter[] = array(
    				'q'=>$prodResult,
    				'c'=>zen_get_products_display_price($dbProducts->fields['products_id']),
    				'l'=>$dbProducts->fields['products_id'],
    				'pc'=>"p",
    				'pr'=>"",
    				'pm'=> (($products_model !='') ? '<span class="product-model">'.TEXT_PRODUCT_MODEL . '<strong>'.$products_model.'</strong></span>' : ''),
    				'img'=>zen_image(DIR_WS_IMAGES . strip_tags($dbProducts->fields['products_image']), strip_tags($dbProducts->fields['products_name']), 85, 106)
    			);	
    		}
    		
    		$dbProducts->MoveNext();
    	  }
    	}
    	
    	
    	
    	//similar to product search but now we search witin categories
    	/*$sqlCategories = "SELECT categories_name, categories_id
    			FROM " . TABLE_CATEGORIES_DESCRIPTION . "
    			WHERE (categories_name  LIKE :wordSearchPlus:) 
    				OR (LEFT(categories_name,LENGTH(:wordSearch:)) SOUNDS LIKE :wordSearch:) 
    			ORDER BY  
    				field(LEFT(categories_name,LENGTH(:wordSearch:)), :wordSearch:) DESC
    			LIMIT 4"; */
    	
    	/*$sqlCategories = "SELECT " . TABLE_CATEGORIES_DESCRIPTION . ".categories_name, " . TABLE_CATEGORIES_DESCRIPTION . ".categories_id, " . TABLE_CATEGORIES . ".categories_image, " . TABLE_CATEGORIES . ".categories_status
    		FROM " . TABLE_CATEGORIES_DESCRIPTION . ", " . TABLE_CATEGORIES . "
    		WHERE " . TABLE_CATEGORIES . ".categories_id = " . TABLE_CATEGORIES_DESCRIPTION . ".categories_id
    			AND " . TABLE_CATEGORIES . ".categories_status <> 0
    			AND ((categories_name LIKE :wordSearchPlus:) OR (LEFT(" . TABLE_CATEGORIES_DESCRIPTION . ".categories_name,LENGTH(:wordSearch:)) SOUNDS LIKE :wordSearch:))
    			AND language_id = '" . (int)$_SESSION['languages_id'] . "'
    		ORDER BY 
    			field(LEFT(" . TABLE_CATEGORIES_DESCRIPTION . ".categories_name,LENGTH(:wordSearch:)), :wordSearch:) DESC";
    		
    	$sqlCategories = $db->bindVars($sqlCategories, ':wordSearch:', $wordSearch, 'string');
    	$sqlCategories = $db->bindVars($sqlCategories, ':wordSearchPlus:', $wordSearchPlus, 'string');
    
    	$dbCategories = $db->Execute($sqlCategories);*/
    	
    	
    	
    	/*if ($dbCategories->RecordCount() > 0) {
    	  while (!$dbCategories->EOF) {
    		//this searches for the number of products within a category
    		$products_count = zen_count_products_in_category($dbCategories->fields['categories_id']).'&nbsp;product(s)'; 
    
    		$prodResult = strip_tags($dbCategories->fields['categories_name']);
    		if (strtolower(substr($prodResult,0,strlen($wordSearch))) == strtolower($wordSearch)){
    			$results[] = array(
    				'q'=>$prodResult,
    				'c'=>$products_count,
    				'l'=>$dbCategories->fields['categories_id'],
    				'pc'=>"c",
    				'pr'=>"",
    				'img'=>zen_image (DIR_WS_IMAGES . zen_get_categories_image($dbCategories->fields['categories_id']), strip_tags($dbCategories->fields['categories_name']), SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT)
    				);
    		}else{
    			$resultsAddAfter[] = array(
    				'q'=>$prodResult,
    				'c'=>$products_count,
    				'l'=>$dbCategories->fields['categories_id'],
    				'pc'=>"c",
    				'pr'=>"",
    				'img'=>zen_image (DIR_WS_IMAGES .  zen_get_categories_image($dbCategories->fields['categories_id']), strip_tags($dbCategories->fields['categories_name']), SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT)
    			);	
    		}
    		$dbCategories->MoveNext();
    	  }
    	}*/
    	
    }
    
    
    //we now re-sort the results so that $results has first priority over $resultsAddAfter
    foreach ($resultsAddAfter as &$value) {
    	$results[] = array(
    		'q'=>$value["q"],
    		'c'=>$value["c"],
    		'l'=>$value["l"],
    		'pc'=>$value["pc"],
    		'pm'=>$value["pm"],
    		'img'=>$value['img']
    	);
    }
    
    unset($value);
    
    
    //the results are now passed onto instantSearch.js
    echo json_encode($results);
    
    
    ?>

  5. #5
    Join Date
    Dec 2009
    Location
    Amersfoort, The Netherlands
    Posts
    2,845
    Plugin Contributions
    25

    Default Re: MultiSite Module Support Forum

    Without being able to test, I think you only need to change 1 line of code.
    Find:
    Code:
    $dbProducts = $db->Execute($sqlProduct);
    and replace with:
    Code:
    $dbProducts = $db->Execute(cat_filter($sqlProduct));
    Quote Originally Posted by Koda View Post
    Hey this mod is working great for me, I am just having trouble applying
    Code:
    (cat_filter)
    to the instant search box. I searched here to no avail, but the thread is quite large and terms quite vague. Here is my templates instant search box. Inserting (cat_filter ) in various places just seems to disable the instant search box from working. Which I will end up doing if I cannot figure this out, but it is a nice feature that I would prefer not to give up. Many thanks in advance.

    Code:
    <?php
    /**
     * @package Instant Search Results
     * @copyright Copyright Ayoob G 2009-2011
     * @copyright Portions Copyright 2003-2006 The Zen Cart Team
     * @copyright Portions Copyright 2003 osCommerce
     * @license http://www.zen-cart.com/license/2_0.txt GNU Public License V2.0
     */
    
    
    //This PHP file is used to get the search results from our database. 
    
    // I don't know if this is nessceary
    header( 'Content-type: text/html; charset=utf-8' );
    
    
    //need to add this
    require('includes/application_top.php');
    global $db;
    
    
    //this gets the word we are searching for. Usually from instantSearch.js.
    $wordSearch = (isset($_GET['query']) ? $_GET['query'] : '');
    
    // we place or results into these arrays
    //$results will hold data that has the search term in the begining of the word. This will yield a better search result but the number of results will be a few.
    //$resultsAddAfter will hold data that has the search term anywhere in the word. This will yield a normal search result but the number of results will be a high.
    //$results has first priority over $resultsAddAfter
    $results=array();
    $resultsAddAfter=array();
    $prodResult;
    
    
    //the search word can not be empty
    if (strlen($wordSearch) > 0) {
        
        //if the user enters less than 2 characters we would like match search results that beging with these characters
        //if the characters are greater than 2 then we would like to broaden our search results
        if (strlen($wordSearch) <= 2) {
            $wordSearchPlus =  $wordSearch . "%";
        }else{
            $wordSearchPlus =  "%" . $wordSearch . "%";
        }
        
        
        //first we would like to search for products that match our search word
        //we then order the search results with respect to the keyword found at the begining of each of the results
        $sqlProduct = "SELECT pd.products_name, p.products_model, pd.products_id, p.products_image, p.products_tax_class_id, p.products_price, p.products_status FROM " . TABLE_PRODUCTS_DESCRIPTION . " as pd , " . TABLE_PRODUCTS . " as p
            WHERE p.products_id = pd.products_id
                AND p.products_status <> 0
                AND ((pd.products_name LIKE :wordSearchPlus:) OR (p.products_model LIKE :wordSearchPlus:)  OR (LEFT(pd.products_name,LENGTH(:wordSearch:)) SOUNDS LIKE :wordSearch:))
                AND language_id = '" . (int)$_SESSION['languages_id'] . "'
            ORDER BY 
                field(LEFT(pd.products_name,LENGTH(:wordSearch:)), :wordSearch:) DESC,
                pd.products_viewed DESC";
                            
        //this protects use from sql injection - i think????
        $sqlProduct = $db->bindVars($sqlProduct, ':wordSearch:', $wordSearch, 'string');
        $sqlProduct = $db->bindVars($sqlProduct, ':wordSearchPlus:', $wordSearchPlus, 'string');
    
    
        $dbProducts = $db->Execute($sqlProduct);
        
        
        //this takes each item that was found in the results and places it into 2 separate arrays
        if ($dbProducts->RecordCount() > 0) {
          while (!$dbProducts->EOF) {
            $prodResult = strip_tags($dbProducts->fields['products_name']);
            $products_model = $dbProducts->fields['products_model'];
            
            if (strtolower(substr($prodResult,0,strlen($wordSearch))) == strtolower($wordSearch)){
                $results[] = array(
                    //we have 4 seperate variables that will be passed on to instantSearch.js
                    //'q' is the result thats been found
                    //'c' is the number of item within a category search (we leave this empty for product search, look at the example bellow for category search)
                    //'l' is used for creating a link to the product or category
                    //'pc' lets us know if the word found is a product or a category
                    //'pr' for the price of product
                    //'img' gets the image of product/category
                    'q'=>$prodResult,
                    'c'=>zen_get_products_display_price($dbProducts->fields['products_id']),
                    'l'=>$dbProducts->fields['products_id'],
                    'pc'=>"p",
                    'pr'=>"",
                    'pm'=> (($products_model !='') ? '<span class="product-model">'.TEXT_PRODUCT_MODEL . '<strong>'.$products_model.'</strong></span>' : ''),
                    'img'=>zen_image(DIR_WS_IMAGES . strip_tags($dbProducts->fields['products_image']), strip_tags($dbProducts->fields['products_name']), 85, 106)
                );
            }else{
                $resultsAddAfter[] = array(
                    'q'=>$prodResult,
                    'c'=>zen_get_products_display_price($dbProducts->fields['products_id']),
                    'l'=>$dbProducts->fields['products_id'],
                    'pc'=>"p",
                    'pr'=>"",
                    'pm'=> (($products_model !='') ? '<span class="product-model">'.TEXT_PRODUCT_MODEL . '<strong>'.$products_model.'</strong></span>' : ''),
                    'img'=>zen_image(DIR_WS_IMAGES . strip_tags($dbProducts->fields['products_image']), strip_tags($dbProducts->fields['products_name']), 85, 106)
                );    
            }
            
            $dbProducts->MoveNext();
          }
        }
        
        
        
        //similar to product search but now we search witin categories
        /*$sqlCategories = "SELECT categories_name, categories_id
                FROM " . TABLE_CATEGORIES_DESCRIPTION . "
                WHERE (categories_name  LIKE :wordSearchPlus:) 
                    OR (LEFT(categories_name,LENGTH(:wordSearch:)) SOUNDS LIKE :wordSearch:) 
                ORDER BY  
                    field(LEFT(categories_name,LENGTH(:wordSearch:)), :wordSearch:) DESC
                LIMIT 4"; */
        
        /*$sqlCategories = "SELECT " . TABLE_CATEGORIES_DESCRIPTION . ".categories_name, " . TABLE_CATEGORIES_DESCRIPTION . ".categories_id, " . TABLE_CATEGORIES . ".categories_image, " . TABLE_CATEGORIES . ".categories_status
            FROM " . TABLE_CATEGORIES_DESCRIPTION . ", " . TABLE_CATEGORIES . "
            WHERE " . TABLE_CATEGORIES . ".categories_id = " . TABLE_CATEGORIES_DESCRIPTION . ".categories_id
                AND " . TABLE_CATEGORIES . ".categories_status <> 0
                AND ((categories_name LIKE :wordSearchPlus:) OR (LEFT(" . TABLE_CATEGORIES_DESCRIPTION . ".categories_name,LENGTH(:wordSearch:)) SOUNDS LIKE :wordSearch:))
                AND language_id = '" . (int)$_SESSION['languages_id'] . "'
            ORDER BY 
                field(LEFT(" . TABLE_CATEGORIES_DESCRIPTION . ".categories_name,LENGTH(:wordSearch:)), :wordSearch:) DESC";
            
        $sqlCategories = $db->bindVars($sqlCategories, ':wordSearch:', $wordSearch, 'string');
        $sqlCategories = $db->bindVars($sqlCategories, ':wordSearchPlus:', $wordSearchPlus, 'string');
    
        $dbCategories = $db->Execute($sqlCategories);*/
        
        
        
        /*if ($dbCategories->RecordCount() > 0) {
          while (!$dbCategories->EOF) {
            //this searches for the number of products within a category
            $products_count = zen_count_products_in_category($dbCategories->fields['categories_id']).'&nbsp;product(s)'; 
    
            $prodResult = strip_tags($dbCategories->fields['categories_name']);
            if (strtolower(substr($prodResult,0,strlen($wordSearch))) == strtolower($wordSearch)){
                $results[] = array(
                    'q'=>$prodResult,
                    'c'=>$products_count,
                    'l'=>$dbCategories->fields['categories_id'],
                    'pc'=>"c",
                    'pr'=>"",
                    'img'=>zen_image (DIR_WS_IMAGES . zen_get_categories_image($dbCategories->fields['categories_id']), strip_tags($dbCategories->fields['categories_name']), SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT)
                    );
            }else{
                $resultsAddAfter[] = array(
                    'q'=>$prodResult,
                    'c'=>$products_count,
                    'l'=>$dbCategories->fields['categories_id'],
                    'pc'=>"c",
                    'pr'=>"",
                    'img'=>zen_image (DIR_WS_IMAGES .  zen_get_categories_image($dbCategories->fields['categories_id']), strip_tags($dbCategories->fields['categories_name']), SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT)
                );    
            }
            $dbCategories->MoveNext();
          }
        }*/
        
    }
    
    
    //we now re-sort the results so that $results has first priority over $resultsAddAfter
    foreach ($resultsAddAfter as &$value) {
        $results[] = array(
            'q'=>$value["q"],
            'c'=>$value["c"],
            'l'=>$value["l"],
            'pc'=>$value["pc"],
            'pm'=>$value["pm"],
            'img'=>$value['img']
        );
    }
    
    unset($value);
    
    
    //the results are now passed onto instantSearch.js
    echo json_encode($results);
    
    
    ?>

  6. #6
    Join Date
    Feb 2011
    Posts
    57
    Plugin Contributions
    0

    Default Re: MultiSite Module Support Forum

    Thank you for the speedy reply! I did just try that, however the nefarious test product is still showing up in the instant search

  7. #7
    Join Date
    Feb 2011
    Posts
    57
    Plugin Contributions
    0

    Default Re: MultiSite Module Support Forum

    It is no biggie really, I am overall extremely satisfied with this module and found it very easy to implement. The only issues I found were with custom themes where certain files were changed, but even those were fairly easy enough to edit out the offending fields. I think it has satisfied pretty much every use case I needed out of it. My instant search wasn't providing me SEO friendly URLs anyways, so it is probably for the best to disable this as to not interfere with google rankings due to duplicate content. I should be finished up with my work by the end of the day and hopefully there are no other holdups, but I might be back if I run into issues with the final stages implementing payment processors for a multi-site running off of the main one. Will see

 

 

Similar Threads

  1. v154 WorldPay Module version 3.0 - Support thread
    By countrycharm in forum Addon Payment Modules
    Replies: 116
    Last Post: 31 Dec 2025, 11:36 AM
  2. Bambora/Beanstream Payment Module Support Thread
    By swguy in forum Addon Payment Modules
    Replies: 127
    Last Post: 26 Mar 2021, 04:13 PM
  3. WorldPay Module version 2.0 - Support thread
    By philip_clarke in forum Addon Payment Modules
    Replies: 729
    Last Post: 4 Nov 2017, 08:23 AM
  4. PC Configurator Module [Support Thread]
    By lebrand2006 in forum All Other Contributions/Addons
    Replies: 254
    Last Post: 22 Aug 2012, 03:52 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
disjunctive-egg