Dev & Tech Notes
San Diego | Los Angeles | Big Bear | USA
Terms & Conditions ©2005-2024 TJohns.co
Terms & Conditions ©2005-2024 TJohns.co
Top Left Text cha
Web & App Development
- Details
- Written by Timothy Johns
- Category: Virtuemart
- Hits: 11506
If you read the documentation on creating a custom product details template for Virtuemart 3.x (and Joomla 3.x of course), you might find it sounding complicated. But it is not at all... at least not if you're used to creating template overrides for other modules and components.
- First, copy the default template that's probably currently being used at [front end] \components\com_virtuemart\views\productdetails\tmpl\default.php. Open default.php and copy the contents into another folder (call it what you want). I called mine tjohns.php.
- Then, in your template folder, create the file path if it's not created already for other overrides you may have made: [front end] \templates\[your template]\html\com_virtuemart\productdetails\tjohns.php (instead of tjohns.php, it would be whatever you called the file).
- In the Virtuemart administration, go to 'configuration' > 'templates' tab. You'll see that the field, 'product layout' is set to 'default'. You can now select the template that you put in your templates folder. In my case, I now have an option for 'tjohns'.
- Take the new template file you added to your template - and edit away!
I haven't tried so I can't say this will work 100%... but you should also be able to do the same thing with the category layout and cart pages.
Add new comment
Comment (0)
Hits: 11506
- Details
- Written by Timothy Johns
- Category: Virtuemart
- Hits: 4289
You'll need to change a few lines in /administrator/components/com_virtuemart/helpers/vmjsapi.php (around line 164) to:
//Todo load BE standard template first
$file = '/administrator/templates/isis/css/template.css';
$document->addStyleSheet($file);
(just change 'bluestork' to 'isis')
Comment (0)
Hits: 4289
- Details
- Written by Timothy Johns
- Category: Virtuemart
- Hits: 2867
EDIT: times have changed. WordPress+WooCommerce is now my favorite CMS e-commerce extension/plugin. It's difficult to make 'pretty', but the functionality is solid (compared to Virtuemart and many others). I no longer use Virtuemart except on old stores where it's already been implemented.
Anyway, you have to get the latest version. Then when you go to install v3.0.6.4 (the latest at the time of writing this), there's a bug in the installer!!! It just tries installing for 5 minutes or so, then goes to a 404 page. Crappy, but it works. If you go to 'manage' in the installation manager, you'll see that the version is now v.3.0.6.4. And the save button works now. I don't know if it's necessary, but I also installed v3.0.6.4 of the aio (all in one) package - just in case. Hopefully this doesn't create more bugs.
EDIT: once again, don't use Joomla for e-commerce. Use WordPress+WooCommerce... or if you must, Shopify might be okay. The absolute best may actually be Magento. But Magento is EXTREMELY overpriced and not affordable for small businesses usually. And it's a pain to host yourself because they don't want you to (they want to host it, thus collecting even more money making it even more expensive - a shame).
Comment (0)
Hits: 2867
- Details
- Written by Timothy Johns
- Category: Virtuemart
- Hits: 10387
Adding size, for example:
Create a custom group of type: String
They tell you to create one called 'cart variant', but there is no such thing.
Here's the only thing you need to know here, but they make no effort in telling you this... nor is there any possible way to know this that I can see. You have to put 'addtocart' in the text field 'Layout position'. How is someone supposed to know that? I must be Psychic.
You also have to check 'cart attribute' and 'cart input'. Makes no sense if it doesn't affect price, but for some reason, you have to check those.
Then you have to go to the individual product and click on the 'custom fields' tab. I don't consider this a custom field... I consider it a cart attribute. But the programmers at VM are somewhat backwards in language and functionality sometimes.
Under 'custom field type', select the custom field you just created.
In the 'value' enter the size, color, etc. like 'small'. And you can leave the price as is or add to it if it will cost more.
Then do it again... select the custom field in the drop down and another one will appear. Enter 'medium'. Do it again and enter 'large'.
After saving you will see it works but looks horrible with that long string of text next to your sizes (or colors) that says 'no additional charge'. You'll need to go into the language file at C:\xampp\htdocs\tjohns\flexyfit\components\com_virtuemart\language\en-GB\en-GB.com_virtuemart.ini and remove 'No additional charge' from line 81 so it says: COM_VIRTUEMART_CART_PRICE_FREE=""
Or you can do a language override as Andrea pointed out (remove No additional charge)
Comment (5)
Hits: 10387