• Super User

    Artio:plug-in per virtuemart,uno "0" nelle url

    Ciao a tutti,
    chiedo di nuovo il vostro aiuto perchè stavolta non so dove smanettare per risolvere il problema che ho incontrato con Artiosef e alcuni "0" che mi piazza nelle url:

    Esempio: www.miosito.com/0/categoria/sub-categoriai/prodotti/prodotto.html

    Allora ho modificato questa parte del codice del plug (che ho postato un pò più giù):

    $prefix = $this->params->get('prefix', '**0**');
    

    Cambiando in:

    $prefix = $this->params->get('prefix', 'shop'); o anche:
    
    $prefix = $this->params->get('shop', '0');
    

    Però succede che la home del negozio (non del sito intero) presenta una url con il numero, tipo:

    http://www.miosito.com/virtuemart/5.html

    Idem per le categorie...anche mettendo virtuemart al posto di shop fa lo stesso lavoro...ho letto qui: http://ewebdev.com questo:

    Used with newest version of ARTIO JoomSEF - 2.2.4
    Software the add-on was tested with:

    • Joomla 1.0.13
    • ARTIO JoomSEF 2.2.4
    • VirtueMart 1.0.13a
      Makes Virtuemart component for Joomla with nice SEF URL's.
      Has unlimited category/subcategory rewriting, can change even the prefix of the url's or leave default: shop
      NOTE: you need to purge SEF URLs to see the new ones. Clear them each time after changing the prefix.
      If there are any problems or concerns, please be free to post to a forum, so I can get to you as soon as possible.
      La mia versione è la **v2.2.4 **, pur facendo quello che dice il sito, non si riesce a far si che anche la home sia "urlata" per bene...solo i prodotti vengono modificati.

    Cosa devo toccare per avere url sane?

    Ah, il plugin è questo:

    [php]<?php
    // Security check to ensure this file is being included by a parent file.
    if (!defined('_VALID_MOS')) die('Direct Access to this location is not allowed.');

    class sefext_com_virtuemart extends sef_404
    {
    var $params;
    function create($string, &$vars) {
    extract($vars);
    // JF translate extension.
    global $sefConfig, $database, $debug, $debug_string, $title;
    $jfTranslate = $sefConfig->translateNames ? ', id' : '';

        $title = array();
    
        $this->params = SEFTools::getExtParams('com_virtuemart');
        $prefix = $this->params->get('prefix', '0');
        if (!$page){
            $title[] = $prefix;
            $title[] = '/';
            $title[] = "index";
        } else {
            $title[] = $prefix;
            $title[] = '/';
        }
    
        if ($page == "shop.browse"){
        //show category only
            
            $this->build_cats($category_id);
            
            $sql = "SELECT category_name FROM #__vm_category WHERE category_id=".$category_id." LIMIT 1";
            $database->setQuery($sql);
            
            $category_name = $database->loadResult();
            $title[] = trim($category_name);
        }
    
    
        //view item
        if ($page == "shop.product_details"){
        //show category/itemname.html
            
            $this->build_cats($category_id);
            
            $sql = "SELECT category_name FROM WHERE category_id=".$category_id." LIMIT 1";
            $database->setQuery($sql);
            
            $category_name = $database->loadResult();
            $title[] = trim($category_name);
    
    
            //itemname
            $sql = "SELECT product_name FROM #__vm_product WHERE product_id=".$product_id." LIMIT 1";
            $database->setQuery($sql);
            $product_name = $database->loadResult();
            $title[] = $product_name;
        }
    
        //not used yet
        //terms of service
        /*
        if ($page == "shop.product_details"){
        //show terms of service
            $title[] = "terms";
        }
        */
        if ($page == "shop.manufacturer_page"){
            $sql = "SELECT mf_name FROM #__vm_manufacturer WHERE manufacturer_id=".$manufacturer_id." LIMIT 1";
            $database->setQuery($sql);
            $manufacturer_name = $database->loadResult();
            $title[] = $manufacturer_name;
        }
    
        if ($page == "checkout.index"){
            $title[] = "checkout";
        }
        if ($page == "account.order_details"){
            $title[] = "orderdetails";
            $title[] = "order-".$order_id;
        }
        //update address
        //http://joomsef210.keiskis.info/component/page,account.billing/next_page,checkout.index/option,com_virtuemart/Itemid,26/
        
        if ($page == "account.billing"){
            $title[] = "update-address";
        }
        //add new shipping address
        //http://joomsef210.keiskis.info/component/page,account.shipto/next_page,checkout.index/option,com_virtuemart/Itemid,26/
        
        if ($page == "account.shipto"){
            $title[] = "add-new-shipping";
        }
        //http://joomsef210.keiskis.info/component/page,checkout.index/option,com_virtuemart/ship_to_info_id,adbdbd4dc5587e08d1bd9925c95992cc/shipping_rate_id,/checkout_next_step,2/Itemid,26/
        //http://joomsef210.keiskis.info/component/page,checkout.index/option,com_virtuemart/ship_to_info_id,adbdbd4dc5587e08d1bd9925c95992cc/shipping_rate_id,flex|STD|Standard%20Shipping%20over%2025.00|17.5386/checkout_next_step,3/Itemid,26/
    
        //http://joomsef210.keiskis.info/component/page,checkout.index/option,com_virtuemart/ship_to_info_id,adbdbd4dc5587e08d1bd9925c95992cc/shipping_rate_id,flex|STD|Standard%20Shipping%20over%2025.00|17.5386/checkout_next_step,4/Itemid,26/
    
    // Handle nonSef variables
        $nonSefVars = array();
        if (isset($shipping_rate_id))       $nonSefVars['shipping_rate_id'] = $shipping_rate_id;
        if (isset($checkout_next_step))  $nonSefVars['checkout_next_step'] = $checkout_next_step;
        if (isset($ship_to_info_id))         $nonSefVars['ship_to_info_id'] = $ship_to_info_id;
        if (isset($next_page))         $nonSefVars['next_page'] = $next_page;
    
    if (count($title) > 0) 
        $string = sef_404::sefGetLocation($string, $title, null, @$limit, @$limitstart, @$lang, $nonSefVars);
    
    
    return $string;
    }
    
    function build_cats($cat){
        global $sefConfig, $database, $debug, $debug_string, $title;
            //look for a parent
            //select parent id
                //if parent id = 0, then no parent, so display only category
                //else show parent+current category
    
            $sql = "SELECT category_parent_id FROM #__vm_category_xref WHERE category_child_id =".$cat." LIMIT 1";
            $database->setQuery($sql);
            $parent_cat_id = $database->loadResult();
            if ($parent_cat_id != 0) {
                $sql = "SELECT category_name FROM WHERE category_id=".$parent_cat_id." LIMIT 1";
                $database->setQuery($sql);
                $parent_name = $database->loadResult();
                $this->build_cats($parent_cat_id);
                $title[] = trim($parent_name);
            } else return;
    }//build_cats()
    

    }
    ?>[/php]Scaricato da:

    http://ewebdev.com/downloads/plugins-for-artio-joomsef-2.2.4/index.php

    Grazie mille a tutti. 😉


  • Super User

    Io ho usato quello del team artio e non ho avuto questo problema, cioè il prefisso non esiste proprio, fa tutto da solo senza impostare nulla.
    Link


  • Super User

    Infatti avevo percepito che l'unico modo era quello di comprare la versione che mi hai linkato.

    Grazie Globo 😉


  • Super User

    Non so se è l'unico modo, visto che qualcosa di free esiste, però posso assicurarti che con una cifra irrisoria avrai a disposizione un componente che fa bene il suo lavoro senza nessun problema ...
    poi vediamo se me ne è avanzato qualcuno, te lo passo io su skype.;)


  • Super User

    @GloboGsm said:

    Non so se è l'unico modo, visto che qualcosa di free esiste, però posso assicurarti che con una cifra irrisoria avrai a disposizione un componente che fa bene il suo lavoro senza nessun problema ...
    poi vediamo se me ne è avanzato qualcuno, te lo passo io su skype.;)

    :D:D

    Grazie, però mi viene anche il dubbio su come sistemare questo...sai quanto sono pignola...finchè non capisco non sto in pace con il mio essere. 😄

    Grazie di nuovo. 😉


  • Super User

    Ok, allora sbatti per benino la testa, poi se non riesci ci proviamo insieme e se non va, passiamo al brute force 😄


  • Super User

    Due giorni...e ancora nulla...eppure non sono tante righe...adesso lo faccio solo per pignoleria! 😄


  • Super User

    La Pika's smanetton force colpisce ancora!

    Credo di aver risolto...o almeno sembra.

    Allora, visto che non funzionava con artiosef ho provato con open sef...risultato? Un disastro, poi l'illuminazione!!

    Ho disinstallato tutto, sia i componenti per le url sef che virtuemart.

    Ho reinstallato artio e virtuemart versione originale inglese.

    Ho cambiato lo "0" della linea 32 del file com_virtumart.php in "shop" , ovvero così:

    [php]$prefix = $this->params->get('prefix', 'shop');[/php]Ho caricato tutto, ho sfoltito le url create da artio, ho creato categoria "cavoletti" e inserito un prodotto "cavoletti di Bruxelles" e tutto ha funzionato!!

    Visto che il mio inglese fa pena, ho installato il file di lingua italiano in componenti amministratore e ho anche il pannello admin di virtuemart in italiano...
    Funziona...almeno adesso, bisogna vedere con il tempo.

    Un saluto 😉