Joomla 3 - Virtuemart - Virtuemar product module - php

I'm using Joomla 3 and Virtuemart 3.0.18.
I'm building a website to show products of my store. So, I created 2 modules in the same type: mod_virtuemart_product. I need one of them display my newest products and other display featured products.
My problem is my website just display one of them in a same page.
Please help me! Thank you so much!
Update:
In my template, I load those modules using like this:
<?php if ($this->countModules('modpro')) : ?>
<div class="modpro">
<div class="container">
<div class="row">
<div class="col-md-12">
<jdoc:include type="modules" name="modpro" style="xhtml" />
</div>
</div>
</div>
</div>
<?php endif; ?>
<?php if ($this->countModules('modnew')) : ?>
<div class="modnew">
<div class="container">
<div class="row">
<div class="col-md-12">
<jdoc:include type="modules" name="modnew" style="xhtml" />
</div>
</div>
</div>
</div>
<?php endif; ?>
I tried setting them in the same position, but it doesn't work.
I disabled one of them, other were be renderred. I set them on difference pages, them were be renderred.

Thanks everyone who viewed this question.
I has found the reason of my issue. In the sortSearchListQuery() function of the VirtueMartModelProduct class, I found these code line:
if(self::$_alreadyLoadedIds){
$where[] = ' p.`virtuemart_product_id`!='.implode(' AND p.`virtuemart_product_id`!=',self::$_alreadyLoadedIds).' ';
//$where[] = ' p.`virtuemart_product_id` NOT IN ('.implode(',',self::$_alreadyLoadedIds).') ';
}
It prevent my second module from loading the same products again.
So, thank you again!

Related

WordPress Toolset - Pagination error

My problem is simple, by I fear the sollution might not be.
I'm working on this site:
http://portugal.dk.linux134.unoeuro-server.com
It's a WordPress solution with Avada Theme and Toolset Plugins enabled.
The only other plugins i run, are BackupBuddy and Contact Form 7.
My problem is, is that the pagination on my blog/post views suddenly stopped working. I've tried several suggestions like turning op the "max_input_vars" to 3000, in php.ini. And increasing the memory_limit to 256M.
To see the problem "in action" try pushing the button "Indlæs flere", under the posts.
I've worked on issues there might be with the Ajax, Jquery og the Wordpress version it self. Nothing seems to be wrong, and the problem just appeared.
I know there is a very logical explanation to this, but i'm lost in trying to find it. So does anyone out there know about WordPress and specifically the Toolset plugin, and can you help me? :)
Here is the documentation on the "view" i'm working on:
SCREENSHOTS OF THE SETTINGS:
LOOP OUTPUT:
[wpv-layout-start]
[wpv-items-found]
<!-- wpv-loop-start -->
<wpv-loop wrap="1" pad="true">
[wpv-item index=1]
<div class="col-sm-6 nth-blog-loop">
[wpv-post-body view_template="loop-item-in-home-blog-view-after-first-two"]
</div>
[wpv-item index=other]
<div class="col-sm-12">[wpv-post-body view_template="loop-item-in-home-blog-view-after-first-two"]</div>
[wpv-item index=pad]
<div class="col-sm-12"></div>
[wpv-item index=pad-last]
<div class="col-sm-12"></div>
</wpv-loop>
<!-- wpv-loop-end -->
[/wpv-items-found]
[wpv-no-items-found]
<strong>[wpml-string context="wpv-views"]No items found[/wpml-string]</strong>
[/wpv-no-items-found]
[wpv-layout-end]
TEMPLATE FOR THE VIEW
<article class="post-article col-sm-12">
<a href="[wpv-post-url]">
<div class="col-sm-12 desktop"><img src="[wpv-post-featured-image size="medium" output="url"]"></div>
<div class="col-sm-12 desktop">
<div class="row">
<h2>[wpv-post-title]</h2>
<p>[types field='headertekst'][/types]</p>
</div>
<div class="row">
<div class="post-info">
<i>[wpv-post-date]</i>
</div>
</div>
</div>
<div class="col-sm-12 mobile"><img src="[wpv-post-featured-image size="medium" output="url"]"></div>
<div class="col-sm-12 mobile">
<div class="row">
<h2>[wpv-post-title]</h2>
<p>[types field='headertekst'][/types]</p>
</div>
<div class="row">
<div class="post-info">
<i>[wpv-post-date]</i>
</div>
</div>
</div>
</a>
<i class="fa fa-angle-right" aria-hidden="true"></i>
</article>
FILTER:
[wpv-layout-meta-html]
[wpv-filter-meta-html]
Go into your View (in Toolset). Then go to the 'pagination' area and check what it says there. It may say 'Default setting = 10'. Just change that to 10. Save it all and refresh the page. This may also help you out: https://wp-types.com/documentation/user-guides/views-shortcodes/#wpv-items-found

Hide a tab with no content on a Magento EE product page

I have successfully added a tab to my view.phtml page located at app/design/frontend/enterprise/aps/template/catalog/product.
I tried an if statement to hide it if the Specifications field is empty, i.e. no content. The issue is, it doesn't work. It still shows the tab even if there is no content.
My code is below at the end of post.
2 Questions:
Am I taking the correct approach? Basically, I am making a tab to have an Expert Review tab. I originally was going to use a cms block, but figured purposing the Specifications field was easier, for one, but also I could ignore the tab if no content
Can you please help ? :)
Thanks so much and here is my code and I attached a screenshot of the empty tabs.
<div class="wa-product-details-tab product-description">
<div class="wa-product-details-tab-heading product-desc-tab">
<div rel=".wa-product-tab-details-item-1" class="wa-product-heading-item wa-product-heading-item-1 wa-product-heading-item-active">
<span>Description</span>
</div>
<div rel=".wa-product-tab-details-item-2" class="wa-product-heading-item wa-product-heading-item-2">
<span>Specs</span>
</div>
<div rel=".wa-product-tab-details-item-3" id="review-form" class="wa-product-heading-item wa-product-heading-item-3">
<?php
$summaryData = Mage::getModel('review/review_summary')
->setStoreId(Mage::app()->getStore()->getId())
->load($_product->getId());
?>
<span >Reviews (<?php echo $summaryData->getReviewsCount();?>)</span>
</div>
<div rel=".wa-product-tab-details-item-4" class="wa-product-heading-item wa-product-heading-item-4">
<span>APS Advisor Review</span>
</div>
</div>
<div class="wa-product-tab-details product-desc">
<div style="display: block;" class="wa-product-tab-details-item wa-product-tab-details-item-1">
<?php echo $_product->getDescription(); ?>
</div>
<div style="display: none;" class="wa-product-tab-details-item wa-product-tab-details-item-2">
<p> <?php echo $this->getChildHtml('additional')?></p>
</div>
<div style="display: none;" class="wa-product-tab-details-item wa-product-tab-details-item-3">
<p>
<?php echo $this->getChildHtml('review_form') ?>
<?php echo $this->getChildHtml('product_additional_data_review') ?>
</p>
</div>
<div style="display: none;" class="wa-product-tab-details-item wa-product-tab-details-item-4">
<?php if ($_product->getSpecifications()); ?>
</div>
</div>
I am not sure if I understood your issue correctly. I am assuming that you want to hide the "APS Advisor Review" tab if there is no content in it.
For this you can use an if condition to check if $_product->getSpecifications() has any content, and show the tab title only if there is any content like this
<?php if( !empty($_product->getSpecifications()) ){ ?> <!-- displays the tab title only if the product has any specifications -->
<div rel=".wa-product-tab-details-item-4" class="wa-product-heading-item wa-product-heading-item-4">
<span>APS Advisor Review</span>
</div>
<php } ?>

How to remove mobile layout from Joomla template?

I use non-responsive Joomla template from Gavick.
For mobile, I started to use Jtouch.
There is a bug in the template, creating duplicate page.
Html is:
<div id="gkMainbodyWrap">
<div id="gkComponent">
<gavern:desktop>
<div class="item-page">
// here is page code
</gavern:desktop>
<gavern:mobile>
<div class="item-page">
// ... here is the page content again !!! ...
</gavern:mobile>
I am trying to find what to delete from the template php file,
to stop this duplication.
Here is the relevant part of the php:
<div id="gkMainbody" class="gkMain">
<div id="gkMainbodyWrap">
<?php if($this->isFrontpage()) : ?>
<?php if($this->getParam('mainbody_frontpage', 'only_component') == 'only_component') : ?>
<div id="gkComponent">
<jdoc:include type="component" />
</div>
<?php elseif($this->getParam('mainbody_frontpage', 'only_component') == 'mainbody_before_component') : ?>
<div id="gkComponent">
<jdoc:include type="component" />
</div>
<?php else : ?>
<div id="gkComponent">
<jdoc:include type="component" />
</div>
<?php endif; ?>
<?php else : ?>
<?php if($this->getParam('mainbody_subpage', 'only_component') == 'only_component') : ?>
<div id="gkComponent">
<jdoc:include type="component" />
</div>
<?php elseif($this->getParam('mainbody_subpage', 'only_component') == 'mainbody_before_component') : ?>
<div id="gkComponent">
<jdoc:include type="component" />
</div>
<?php else : ?>
<div id="gkComponent">
<jdoc:include type="component" />
</div>
<?php endif; ?>
<?php endif; ?>
</div>
</div>
Maybe I am an Idiot, but all this if-else seems to be doing the same.
Any help of how to remove the code creating duplication will be very much appreciated,
Help a dime in distress :)
You're not an idiot, as for the person that wrote that if well… that's another story.
Let me re-write that gkMainbodyWrap for you:
hmmm…
<div id="gkMainbody" class="gkMain">
<div id="gkMainbodyWrap">
<div id="gkComponent">
<jdoc:include type="component" />
</div>
</div>
</div>
The <gavern:mobile> and <gavern:desktop> tags are probably intended to be processed by their template framework/code base and are probably meant to act as a switching mechanism of some sort, like a basic type of progressive enhancement (aka Adaptive web design). So, possibly JTouch is interfering with the Gavick code.
Last I looked JTouch was a mobile adaptive/reactive solution not a responsive one, and those gavern tags look like an attempt at adaptive block markers, is it possible that the template while not responsive is actually adaptive?

Kirby snippet shows only 10 subpages

I'm working on this (NSFW), I created 12 subpages but only 10 are showing in the list.
I'm not using any limit() or pagination() in the snippet nor in the panel config, I can't find where this limit is regulated. My guess is a numbering issue, because if in the panel I drag up the 11th subpage up, anything below will not be displayed.
Any clue?
php:
<section id="entries">
<ul>
<li>
<div class="line asger">
<div class="text">00</div>
<div class="text bold">Asger Carlsen</div>
</div>
</li>
<?php $n = 1; foreach($pages->children()->visible()->sortBy('date', 'asc') as $entries): ?>
<li>
<div class="line">
<div class="text">0<?php echo $n++; ?></div>
<div class="table"><div class="text bold"><?php echo kirbytext($entries->title()) ?></div></div>
<div class="text"><?php echo kirbytext($entries->kind()) ?></div>
</div>
<div class="description hidden">
<?php echo kirbytext($entries->description()) ?>
</div>
<div class="left-half">
<img class="images hidden" src="<?php echo $entries->images()->first()->url() ?>" alt="<?php echo html($entries->title()) ?>" />
</div>
</li>
<?php endforeach ?>
</ul>
</section>
Folder structure: https://www.dropbox.com/s/8gigspwup0kwqei/Screenshot%202014-09-03%2015.39.51.png?dl=0
Your folder-structure is defiantly correct. You only could try to rename 04-2001 to something like 04-foo2001 but i don`t think that this causes your issue.
I had some quite similar behavior once. It was caused by image-metadata txt's that had the same name like the page-content txt's. So maybe it would be helpful if you show us your complete folder-structure including the files/filenames.
Next idea: Are you sure you have no invalid markdown in your txt's?
PS: This should be a comment, but i’m at 49 reputation, so i’m not allowed to comment ;) cheers!
It was probably a combination of .txt name conflict plus a missing image from a page.

Displaying last 3 blog posts on wordpress custom theme

I have a custom theme I am working on in wordpress, and I want to display the last 3 blog posts made onto my home page. I also want to style certain information regarding each post differently, like have the month and year be a certain font, and the day be much bolder and different font as well, along with displaying like a sentence or less of the article, followed by a "..." and "read more" type of thing.
How do I pull data from the blog? I know there are certain wordpress functions that can get me this data but I haven't been able to quite figure out how to do it, I'm not really well versed in the wordpress php functions. Right now I just have it hard coded but it's annoying to have to retype everything when I make a new post. I know you can set to show however many blog posts on the settings->reading but I want to be able to fully customize how it looks.
Let me know any suggestions on how I should go about doing this!
<div class="bottom">
<div class="wrap-2">
<h2>Blog</h2>
<div class="content-div">
<div class="bottom_box">
<div class="btm-img"><h4>April <span>25</span><br />2014</h4></div>
<div class="right_block">
<p class="highlight2">blog title 1</p>
<p class="highlight3">lksj sldkf jsl lsdkfj sdklf sd</p>
Read More >
</div>
</div>
<div class="bottom_box">
<div class="btm-img"><h4>April <span>24</span><br />2014</h4></div>
<div class="right_block">
<p class="highlight2">blog title 2</p>
<p class="highlight3">lsdkjf lsdk fjsl dkkddk lsdkfjpaskldfj;</p>
Read More >
</div>
</div>
<div class="bottom_box">
<div class="btm-img"><h4>April <span>23</span><br />2014</h4></div>
<div class="right_block">
<p class="highlight2">blog title 3</p>
<p class="highlight3">lksdjf slkdfjsldkfj;as dfklsd;j fsld;kfj</p>
Read More >
</div>
</div>
</div>
</div>
</div>
Try the snippet below. Use your custom HTML block (the one with botom_box class) instead of this used below.
<?php $posts = get_posts("numberposts=3"); ?>
<?php if($posts) : ?>
<?php foreach( $posts as $post ) : setup_postdata( $post ); ?>
<!-- your HTML block goes here --->
<div class="post">
<h3><a href="<?php echo get_permalink($post->ID); ?>" ><?php echo $post->post_title; ?></a></h3>
<?php the_excerpt(); ?>" rel="bookmark">read more</a>
</div>
<!-- end of the HTML block -->
<?php endforeach; ?>
<?php endif; ?>

Categories