Viewing 12 posts - 1 through 12 (of 12 total)
  • Author
    Posts
  • Ian Friend
    #187973

    Hi guys, i am using joomla 2.5.11 vm 2.0.20 and i am trying to get products at tabs from subcategories of vm but without luck, module
    JA VM Products displays only top-parent categories and none of subcategories.
    How can i fix it, is it a bug or something else?
    Thanks

    MoonSailor Friend
    #494720

    Hi andronopoulos,

    <blockquote>JA VM Products displays only top-parent categories and none of subcategories.</blockquote>

    I tried to check it in developer site, it’s showing as normal. Pls send PM to me with url and admin access of your site for closer checking.

    Regards

    Ian Friend
    #494842

    Hi, thanks for your reply,
    the problem is that module can’t get subcategories so it can’t display products that belong to a subcategory, gets only root categories, are you saying that you can display, at backed settings, subcategories???

    MoonSailor Friend
    #494931

    Hi ,

    <blockquote>it can’t display products that belong to a subcategory, gets only root categories</blockquote>

    It’s bug of this module. It’s raised to dev team and will be fixed soon. You can check the status here : http://pm.joomlart.com/browse/JAECVMPROD-3

    When it’s fixed, I will be back to you.

    Regards

    Ian Friend
    #494968

    Hi, thanks for info… well i got a project running, fixed soon=???
    Thanks

    MoonSailor Friend
    #494973

    Hi andronopoulos,

    It’s fixed. Please open file “mod_javmproducts/assets/elements/vmcategories.php” find code:

    [PHP]
    self::categoryListTreeLoop ($selectedCategories, $childId, $level, $disabledFields);
    [/PHP]
    and change it to :
    [PHP]
    $categoryTree .= ShopFunctions::categoryListTreeLoop ($selectedCategories, $childId, $level, $disabledFields);
    [/PHP]

    If it’s hard for you, you can send PM to me with ftp access of your site, i will fix it for you.

    Regards

    Ian Friend
    #495002

    Hi, thanks for your response, i replaced the code and now i can see at backed subcategories but at front gives blank module and is strange when select a category or sub when you save it posted 3 times at backed pls see my code

    <?php
    defined('_JEXEC') or die();

    /**
    *
    * @package VirtueMart
    * @subpackage Plugins - Elements
    * @author Valérie Isaksen
    * @link http://www.virtuemart.net
    * @copyright Copyright (c) 2004 - 2011 VirtueMart Team. All rights reserved.
    * @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
    * VirtueMart is free software. This version may have been modified pursuant
    * to the GNU General Public License, and as distributed it includes or
    * is derivative of works licensed under the GNU General Public License or
    * other free or open source software licenses.
    * @version $Id: $
    */
    if (!class_exists('VmConfig'))
    require(JPATH_ROOT . DS . 'administrator' . DS . 'components' . DS . 'com_virtuemart' . DS . 'helpers' . DS . 'config.php');

    if (!class_exists('ShopFunctions'))
    require(JPATH_VM_ADMINISTRATOR . DS . 'helpers' . DS . 'shopfunctions.php');
    if (!class_exists('TableCategories'))
    require(JPATH_VM_ADMINISTRATOR . DS . 'tables' . DS . 'categories.php');

    if (!class_exists('VmElements'))
    require(JPATH_VM_ADMINISTRATOR . DS . 'elements' . DS . 'vmelements.php');
    /*
    * This element is used by the menu manager
    * Should be that way
    */
    class VmElementVmCategories extends VmElements {

    var $type = 'vmcategories';

    // This line is required to keep Joomla! 1.6/1.7 from complaining
    function getInput() {
    $key = ($this->element['key_field'] ? $this->element['key_field'] : 'value');
    $val = ($this->element['value_field'] ? $this->element['value_field'] : $this->name);
    $ispublish = ($this->element['publish'] ? $this->element['publish'] : '0');
    $lang = JFactory::getLanguage();
    $lang->load('com_virtuemart',JPATH_ADMINISTRATOR);
    $value = $this->value?$this->value:array();
    $categorylist = $this->categoryListTree($value,$ispublish);
    if($categorylist){
    $html = '<select class="inputbox" name="' . $this->name . '[]" multiple="multiple">';
    //$html .= '<option value="0">' . JText::_('COM_VIRTUEMART_CATEGORY_FORM_TOP_LEVEL') . '</option>';
    $html .= $categorylist;
    $html .="</select>";
    }else{
    $html = '<span color="red">'.JText::_('COM_VIRTUEMART_CATEGORY_DOES_NOT_CREATED_CATEGORIES').'</span>';
    }
    return $html;
    }
    /**
    * Creates structured option fields for all categories
    *
    * @todo: Connect to vendor data
    * @author RolandD, Max Milbers, jseros
    * @param array $selectedCategories All category IDs that will be pre-selected
    * @param int $cid Internally used for recursion
    * @param int $level Internally used for recursion
    * @return string $category_tree HTML: Category tree list
    */
    static public function categoryListTree($selectedCategories = array(),$ispublish=0, $cid = 0, $level = 0, $disabledFields = array()) {

    //self::$counter++;
    $publish = false;
    if ($ispublish==1) {
    $publish = true;
    }
    static $categoryTree = '';

    $virtuemart_vendor_id = 1;

    // vmSetStartTime('getCategories');
    $categoryModel = VmModel::getModel ('category');
    $level++;

    $categoryModel->_noLimit = TRUE;
    $app = JFactory::getApplication ();
    $records = $categoryModel->getCategories ($publish, $cid);
    // vmTime('getCategories','getCategories');
    $selected = "";
    if (!empty($records)) {
    foreach ($records as $key => $category) {

    $childId = $category->category_child_id;

    if ($childId != $cid) {
    if (in_array ($childId, $selectedCategories)) {
    $selected = 'selected="selected"';
    } else {
    $selected = '';
    }

    $disabled = '';
    if (in_array ($childId, $disabledFields)) {
    $disabled = 'disabled="disabled"';
    }

    if ($disabled != '' && stristr ($_SERVER['HTTP_USER_AGENT'], 'msie')) {
    //IE7 suffers from a bug, which makes disabled option fields selectable
    } else {
    $categoryTree .= '<option ' . $selected . ' ' . $disabled . ' value="' . $childId . '">';
    $categoryTree .= str_repeat (' - ', ($level - 1));

    $categoryTree .= $category->category_name . '</option>';
    }
    }

    if ($categoryModel->hasChildren ($childId)) {
    $categoryTree .= ShopFunctions::categoryListTreeLoop ($selectedCategories, $childId, $level, $disabledFields);
    }

    }
    }

    return $categoryTree;
    }

    }

    if (JVM_VERSION === 2 ) {

    class JFormFieldVmCategories extends VmElementVmCategories {

    }

    } else {

    class JElementVmCategories extends VmElementVmCategories {

    }

    }

    Ian Friend
    #495006

    i have install again module and i replace again the code, now i can see and the products but at the backend each subcategory appears 3 times when i save parameters… but for now its ok thanks!!!

    Ian Friend
    #495897

    Hi again,
    well module working but the problem exists with repeated categories when you are going to select them from backet is (see my previous post) it happening only to me?
    Thanks.

    MoonSailor Friend
    #495898

    Hi andronopoulos ,

    <blockquote>but for now its ok thanks!!!</blockquote>

    Pls send PM to me with url and admin access of your site. I’ll recheck for you.

    Regards

    Ian Friend
    #495900

    Ok, check your msgs

    MoonSailor Friend
    #496018

    Hi,

    Pls check again, I can not access your site.

    Regards

Viewing 12 posts - 1 through 12 (of 12 total)

This topic contains 12 replies, has 2 voices, and was last updated by  MoonSailor 10 years, 10 months ago.

We moved to new unified forum. Please post all new support queries in our New Forum