Results 1 to 10 of 1878

Threaded View

  1. #11
    Join Date
    Sep 2009
    Location
    Stuart, FL
    Posts
    13,413
    Plugin Contributions
    94

    Default Re: Edit Orders v4.0 Support Thread

    Thanks, lhungil. I found another "funny" with the dropdown (and possibly other flavors) of attributes; the ordering of the attribute values in the dropdown were all over the place, i.e. not in their defined sort-order. I made the following change to the /YOUR_ADMIN/includes/classes/attributes.php module to correct:
    Code:
    	/**
    	 * Returns a multidimensional array containing the product attribute options
    	 * id / name / value rows for the specified product sorted by option id.
    	 *
    	 * @param int|string $zf_product_id the specified product id.
    	 * @param bool $readonly include readonly attributes not required to add a
    	 *        product to the cart, defaults to false.
    	 * @return array
    	 */
    	function get_attributes_options($zf_product_id, $readonly = false) {
    		global $db;
    		$query = 'SELECT attr.products_attributes_id, attr.products_id, attr.options_id, opt.products_options_name, val.products_options_values_name, opt.products_options_type, products_options_size, opt.products_options_rows ' .
    			'FROM ' . TABLE_PRODUCTS_ATTRIBUTES . ' AS attr ' .
    			'LEFT JOIN ' . TABLE_PRODUCTS_OPTIONS .
    				' AS opt ON attr.options_id = opt.products_options_id ' .
    			'LEFT JOIN ' . TABLE_PRODUCTS_OPTIONS_VALUES .
    				' AS val ON attr.options_values_id = val.products_options_values_id ' .
    			'WHERE attr.products_id = \'' . (int)$zf_product_id . '\' ' .
    				'AND val.language_id = \'' . (int)$_SESSION['languages_id'] . '\' ' .
    				'AND val.language_id = opt.language_id ';
    
    		// Don't include READONLY attributes if product can be added to cart without them
    		if(PRODUCTS_OPTIONS_TYPE_READONLY_IGNORED == '1' && $readonly === false) {
    			$query .= 'AND opt.products_options_type != \'' . PRODUCTS_OPTIONS_TYPE_READONLY . '\' ';
    		}
    
    //-bof-20140712-lat9-Fix up attributes' sort order.
    //		$query .= 'ORDER BY `opt`.`products_options_sort_order`, `attr`.`options_id`';
    		$query .= 'ORDER BY `attr`.`options_id`, `attr`.`products_options_sort_order`';
    //-eof-20140712-lat9
    
    		if($this->cache_time == 0) $queryResult = $db->Execute($query);
    		else $queryResult = $db->Execute($query, false, true, $this->cache_time);
    
    		$retval = array();
    		while (!$queryResult->EOF) {
    			$retval[$queryResult->fields['products_attributes_id']] = array(
    				'id' => $queryResult->fields['options_id'],
    				'name' => $queryResult->fields['products_options_name'],
    				'value' => $queryResult->fields['products_options_values_name'],
    				'type' => $queryResult->fields['products_options_type'],
    				'length' => $queryResult->fields['products_options_length'],
    				'size' => $queryResult->fields['products_options_size'],
    				'rows' => $queryResult->fields['products_options_rows']
    			);
    			$queryResult->MoveNext();
    		}
    		return $retval;
    	}
    Last edited by lat9; 12 Jul 2014 at 01:50 PM. Reason: fix spelling error

 

 

Similar Threads

  1. v150 Super Orders v4.0 Support Thread for ZC v1.5.x
    By DivaVocals in forum Addon Admin Tools
    Replies: 804
    Last Post: 18 Apr 2025, 12:04 AM
  2. v150 Orders Status History -- Updated By [Support Thread]
    By lat9 in forum Addon Admin Tools
    Replies: 34
    Last Post: 29 Jul 2019, 07:05 PM
  3. Edit Orders v3.0 for ZC 1.3.9 [Support Thread]
    By DivaVocals in forum All Other Contributions/Addons
    Replies: 656
    Last Post: 18 Apr 2016, 06:28 PM
  4. v139h Super Orders v3.0 Support Thread (for ZC v1.3.9)
    By DivaVocals in forum All Other Contributions/Addons
    Replies: 1018
    Last Post: 28 Apr 2014, 11:38 PM
  5. RE: Super Orders v3.0 Support Thread
    By Johnnyd in forum All Other Contributions/Addons
    Replies: 0
    Last Post: 22 Jun 2011, 09:28 AM

Bookmarks

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
Zen-Cart, Internet Selling Services, Klamath Falls, OR