One of my webpages based on joomla's Virtuemart. How I handle it.
1. Copy website from virtuemart on localhost. Joomla version 3.6.2. Virtuemart version 3.2.12. You can download virtuemart already with joomla.
1.1. In /var/www/html create new catalog 'virt'
1.2. Install Joomla 3.6.2 or virtuemart with joomla.
1.3. configuration.php wasn't created. I try to copy from other site and edit it. // It starts to work but with errors.
1.4. Probably I have to change permission for catalog to 777 or change user to www-data.
1.4.1. $ sudo chmod -R 777 virt // Helped
1.4.2. Add template folder from webserver. From Admin panel -> Extension -> Manage -> Discover
1.5. Move database. Make export from phpmyadmin.
1.6. Made archive $ tar -czvf db.tar.gz exported-database.sql then import .sql file with phpmyadmin // I got multiple errors: Unexpected character. (near "" at position 21)
1.6.1. Select database you want to export then Export with Custom method and choose .gz format. When Import select database you want to Import.
1.6.2. I got a timeout error: Script timeout passed, if you want to finish import, please resubmit the same file and import will resume. I need to increase timeout.
1.6.3. Increase varible value $cfg['ExecTimeLimit'] in /usr/share/phpmyadmin/libraries/config.default.php file // I sill get an error Script timeout passed. But all the tables are inserted. And all the rows are inserted.
1.7. While tried to install languages. I got an error: Duplicate entry '0' for key '#__updates.PRIMARY' SQL=INSERT INTO `#__updates` (`update_site_id`,`name`,`description`,`element`,`type`,`folder`,`client_id`,`version`,`detailsurl`,`infourl`,`extra_query`) VALUES ('3','Afrikaans','','pkg_af-ZA','package','','0','3.9.16.1','https://update.joomla.org/language/details3/af-ZA_details.xml','','')
1.7.1. Delete rows with languages from '__updates' tables. // Doesn't help
1.7.2. Just copy folder with languages from old site to new one /var/www/html/virt/administrator/language
2. Add favicon in joomla.
2.1. Favicon should be 32x32 pixel and 24 bit of color, PNG.
2.2. Name must be favicon.ico and it should be placed in the root of the template.
3. To modify modul style in joomla go to Admin Panel -> Extensions -> Modules -> Advanced -> Module Class Suffix then Enter your custom css suffix here.
3.1. Create amycustom.css file in template-name/css folder
3.2. Add new amycustom.css in template's index.php:
$doc->addStyleSheet('templates/'.$this->template.'/css/amycustom.css');
3.3. CSS priorities. Highest priority has id_tag then css_tag the lowest one is tag_name. CSS rules defined inside of html document has priority over css rules in external css files. To override priority use "!important".
3.4. The problem is dropdown list limitet by border of a parent block. // Solution is to define in parent element overflow:unset instead of overflow:hidden.
4. Hide top menu bar on small screens.
4.1. Use display:none when screen is small:
4.2. For top menu set Admin Panel -> Extensions -> Modules -> Advanced -> custom id "topmenu-custom-id".
4.3. Add button to expand the menu. Add three strips image or symbol into index.php div=top:
<button class="navbar-toggler" type="button" onclick="myF()">
<span class="navbar-toggler-icon">㊂</span>
</button>
4.4. Add my.js script which button will trigger.
4.5. Modify index.php of template $doc->addScript($this->baseurl.'/templates/'.$this->template.'/js/my.js');
5. Attach topnavbar to the top of the viewport. // Set position:fixed
5.1. List elements overlap fixed menu. Z-index doesn't help.
Key folder in safepath unaccessible 6. If I delete the templates designer's link from the template (which reffer developer's website) the page gives me an error and create alert pop-up. I'll try to find and delete this alert popup with webdev debugger.
6.1. I opened Web developer tool -> Source -> Event Listner breakpoint -> Set all marks on all events. To catch which .js file starts this alert. // Doesn't helped.
6.2. I set breakpoints to all the strings of all js files which belongs to the template. // I found that popup started by jquery.isotope.min.js now I will prettify this file and will try to catch exact piece of code causing popup.
6.3. After prittyfing the jquery.isotope.min.js I see this malisious vendor's code even without debugging. At the very end of the file:
var asjQuery = jQuery.noConflict();
asjQuery(window).load(function(){
alrt='De';
trade='fo';
siteurl='sd';
comp=site='E';
alrt+='sig';
trade+='ot';
alrt+='ned';
siteurl+='es';
alrt+=' b';
site+='M';
comp+='SI';
trade+='er';
alrt+='y A';
asde=document.getElementById(trade).innerHTML;
alrt+='S D';
siteurl+='ig';
alrt+='esi';
site+='PL';
comp+='GN';
alrt+='gni';
siteurl+='ni';
site+='A';
comp+='IN';
alrt+='ng';
siteurl+='ng';
per = asde.search(siteurl);
if(per < 0){alert(alrt);}
site+='T';
comp+='G';
per = asde.search(site);
percomp = asde.search(comp);
if(per < 0 && percomp < 0){alert(alrt);}
});
As you can see they divided strings to the small parts. To make it imposible to find with search. Very clever. Just delete this crap from the end of the file and use.
7. Doesn't shows button "Add to cart".
7.1. Add price for an item. // Works
7.2. Links to other category items are showed at the top of item title. I didn't find how to disable it from admin panel. I have to look into template.
7.2.1. It belongs to class "product-neighbours". Templates are located in components/com_virtuemart/views/productdetails/tmp.
<?php
// Product Navigation
if (VmConfig::get('product_navigation', 1)) {
?>
<div class="product-neighbours">
<?php
if (!empty($this->product->neighbours ['previous'][0])) {
$prev_link = JRoute::_('index.php?option=com_virtuemart&view=productdetails&virtuemart_product_id=' . $this->product->neighbours ['previous'][0] ['virtuemart_product_id'] . '&virtuemart_category_id=' . $this->product->virtuemart_category_id, FALSE);
echo JHtml::_('link', $prev_link, $this->product->neighbours ['previous'][0]
['product_name'], array('rel'=>'prev', 'class' => 'previous-page','data-dynamic-update' => '1'));
}
if (!empty($this->product->neighbours ['next'][0])) {
$next_link = JRoute::_('index.php?option=com_virtuemart&view=productdetails&virtuemart_product_id=' . $this->product->neighbours ['next'][0] ['virtuemart_product_id'] . '&virtuemart_category_id=' . $this->product->virtuemart_category_id, FALSE);
echo JHtml::_('link', $next_link, $this->product->neighbours ['next'][0] ['product_name'], array('rel'=>'next','class' => 'next-page','data-dynamic-update' => '1'));
}
?>
<div class="clear"></div>
</div>
<?php } // Product Navigation END
?>
It checks if VmConfig('product_navigation') equal 1. This helps me found the checkbox to switch off Virtuemart->Configuration->Shopfront->Product Listing->Show the product navigation
7.3. When I open a virtuemart module from Admin Panel I get en error: Module XML data not available
7.3.1. Probably this problem connected with capital letters. Try to change capital letters to lowercase. // Doesn't helped.
7.3.2. Folder modules/ doesn't contain modules/mod_virtuemart_currencies/ with xml file
7.4. Currency module. When I click on dropdown list it hided behind of module body.