lmarazzo VIP
Total posts: 98
12 Jun 2019 15:25

Sergei! I've been trying to get this page to become responsive and I got an idea but I can't make it work perfectly... can you help me out? https://onlinemusicguild.com/all-the-plans.html

<?php
/**
* Emerald by MintJoomla
* a component for Joomla! 1.7 CMS ( http://www.joomla.org )
* Author Website:  http://www.mintjoomla.com/ 
* @copyright Copyright (C) 2012 MintJoomla ( http://www.mintjoomla.com ). All rights reserved.
* @license GNU/GPL  http://www.gnu.org/copyleft/gpl.html 
*/
defined('_JEXEC') or die();
$user = JFactory::getUser();
$plans = $this->plans;
$width = round(2 / count($plans), 4);
?>
<style>
/*
Generic Styling, for Desktops/Laptops
*/
table {
width: 100%;
border-collapse: collapse;
}
/* Zebra striping */
tr:nth-of-type(odd) {
background: #eee;
}
th {
background: #ccc;
color: white;
font-weight: bold;
}
td, th {
padding: 6px;
border: 1px solid #ccc;
text-align: left;
}
/*
Max width before this PARTICULAR table gets nasty
This query will take effect for any screen smaller than 760px
and also iPads specifically.
*/
@media
only screen and (max-width: 760px),
(min-device-width: 768px) and (max-device-width: 1024px) {
/* Force table to not be like tables anymore */
table, thead, tbody, th, td, tr {
display: block;
}
/* Hide table headers (but not display: none;, for accessibility) */
thead tr {position: relative;}
tr { border: 1px solid #ccc; }
td {
/* Behave like a "row" */
border: none;
border-bottom: 1px solid #eee;
position: relative;
}
}
}
</style>
<table>
<thead>
<?php foreach($plans AS $item):?>
<th align="left">
<h4>
<?php echo $item->name;?>
</h4>
</th>
<?php endforeach; ?>
</thead>
<tr>
<?php foreach($plans AS $item):?>
<td align="left">
<?php if($item->require_one_of): ?>
<div class="alert alert-danger"><?php echo str_replace('[PLANS]', implode(', ', $item->require_one_of), JText::plural('SUBSCRIPTION_ONE_OF', count($item->require_one_of))); ?></div>
<?php elseif($item->require_all_of): ?>
<div class="alert alert-danger"><?php echo str_replace('[PLANS]', implode(', ', $item->require_all_of), JText::plural('SUBSCRIPTION_ALL_OF', count($item->require_all_of))); ?></div>
<?php elseif($item->price <= 0 && !$item->params->get('properties.terms')): ?>
<a class="btn btn-success" href="/<?php echo JRoute::_('index.php?option=com_emerald&task=empayment.send&sid='.$item->id); ?>"><?php echo JText::_('EBTNGETNOW'); ?></a>
<?php elseif(!$item->is_donation): ?>
<a href="/<?php echo JRoute::_('index.php?option=com_emerald&view=empayment&sid='.$item->id); ?>" class="btn btn-primary">
<?php echo JText::_('EBTNBUYNOW'); ?></a>
<?php else: ?>
<a href="/<?php echo JRoute::_('index.php?option=com_emerald&view=empayment&sid='.$item->id); ?>" class="btn btn-primary">
<?php echo JText::_('EBTNDONATE'); ?></a>
<?php endif; ?>
</td>
<?php endforeach; ?>
</tr>
</table>
<script type="text/javascript">
(function($){
$.each($('.alert-plan'), function(){
if(!$.trim($(this).text()))    {
$(this).hide();
}
});
}(jQuery))
</script>

Last Modified: 25 Mar 2020


hakana VIP
Total posts: 412
12 Jun 2019 16:37

Depending on your bootstrap version, you can wrap the table with a div with a table-responsive class. This is how I did it on my website.

You can check it here:
https://www.w3schools.com/bootstrap/bootstrap_ref_css_tables.asp


Sergey
Total posts: 13,702
13 Jun 2019 05:50

Tables are not very responcive. I am not sure how to do that apart from creating new template based on DIVs. I think Hakana knows what he is talking about, I would follow him.


Giorgi625 VIP
Total posts: 573
13 Jun 2019 13:44

Click here to link...

I think in older BS versions this will be same way.


pepperstreet VIP
Total posts: 3,832
20 Jun 2019 01:22

How should it look like? How should it behave?


lmarazzo VIP
Total posts: 98
20 Mar 2020 19:59

I ran into a problem with only one of my emerald empayment templates. This problem does not happen in my other websites:

"ERROR
Payment gateway /home/lmarazzo/public_html/ascoltando/components/com_emerald/library/gateways//.php has not been found!"

How to reproduce:

Go to: https://ascoltando.org/events/si-kids.html?view=empayment& ;sid=9

apply code: [email protected]

Enter a random email.

Check out the plan for FREE

PayPal works PERFECTLY!

But for some reason, when the plan is free, it glitches like this... I dont know why! THis is the code where you can see what I did... honestly, Im confused cuz I did not modify this part!

<?php if($total <= 0): ?>
<p>
<?php echo JText::_('EMR_FREEPLAN'); ?>
</p>
<button class="btn btn-large btn-block btn-warning" id="payfree" type="button"><?php echo JText::_('EMR_ACTIVATENOW'); ?></button>
<?php else: ?>
<div class="well payment-buttons" style="text-align:right">
<?php //if(JFactory::getUser()->id==807) : ?>
<fieldset class="checkboxes" style="float:left;text-align:left;">
<label class="checkbox">
<input type="checkbox" id="consent1" />I accept relevant emails to this plan *
</label>
<label class="checkbox">
<input type="checkbox" id="consent2" />I understand that I am responsible for my learning experience *
</label>
<label class="checkbox">
<input type="checkbox" id="consent3" />I agree to the <a href="/terms-of-service.html" target="_blank">Terms of Service</a> *
</label>
</fieldset>
<script>
jQuery(document).ready(function($){
$('.payment-buttons button').attr('disabled','disabled');
$('#consent1,#consent2,#consent3').change(function(){
if($('#consent1').is(':checked') && $('#consent2').is(':checked') && $('#consent3').is(':checked'))
{
$('.payment-buttons button').removeAttr('disabled');
}
else
{
$('.payment-buttons button').attr('disabled','disabled');
}
})
});
</script>
<?php foreach($this->plan->params->get('gateways', array()) AS $processor => $gateway): ?>
<?php
if($gateway->enable == 0)
{
continue;
}
include_once JPATH_ROOT . '/components/com_emerald/library/gateways/' . $processor . '/' . $processor . '.php';
$class = 'EmeraldGateway' . ucfirst($processor);
$class = new $class($processor, $gateway);
echo $class->getButton($this->plan, $total);
?>
<?php endforeach; ?>
<div style="clear:both"></div>
</div>
<?php if($this->plan->params->get('gateway.message')): ?>
<?php //echo JText::_($this->plan->params->get('gateway.message')); ?>
<?php endif; ?>
<?php endif; ?>
<input type="hidden" name="task" value="">
<input type="hidden" name="processor" value="">
<input type="hidden" name="sid" value="<?php echo $this->plan->id; ?>">
</form>
<br>
<script type="text/javascript">
(function($) {
$('button[data-payment-gateway]').click(function() {
if($('#invoiceto_fields_billto').length && !$('#invoiceto_fields_billto').val()) {
alert('<?php echo str_replace("'", "\\'", JText::sprintf('JLIB_FORM_VALIDATE_FIELD_REQUIRED', JText::_('E_INVOICE_BILLTO'))); ?>');
return;
}
if($('#invoiceto_fields_address').length && !$('#invoiceto_fields_address').val()) {
alert('<?php echo str_replace("'", "\\'", JText::sprintf('JLIB_FORM_VALIDATE_FIELD_REQUIRED', JText::_('E_INVOICE_ADDRESS'))); ?>');
return;
}
if($('#invoiceto_fields_zip').length && !$('#invoiceto_fields_zip').val()) {
alert('<?php echo str_replace("'", "\\'", JText::sprintf('JLIB_FORM_VALIDATE_FIELD_REQUIRED', JText::_('E_INVOICE_ZIP'))); ?>');
return;
}
if($('#invoiceto_fields_country').length && !$('#invoiceto_fields_country').val()) {
alert('<?php echo str_replace("'", "\\'", JText::sprintf('JLIB_FORM_VALIDATE_FIELD_REQUIRED', JText::_('E_INVOICE_COUNTRY'))); ?>');
return;
}
if($('#invoicetofieldsstate').length && !$('#invoicetofieldsstate').val()) {
alert('<?php echo str_replace("'", "\\'", JText::sprintf('JLIB_FORM_VALIDATE_FIELD_REQUIRED', JText::_('ESTATE'))); ?>');
return;
}
<?php if($this->com_params->get('tax_id_rec', 1)): ?>
if($('#invoiceto_fields_tax_id').length && !$('#invoiceto_fields_tax_id').val()) {
alert('<?php echo str_replace("'", "\\'", JText::sprintf('JLIB_FORM_VALIDATE_FIELD_REQUIRED', JText::_('E_INVOICE_TAX_ID'))); ?>');
return;
}
<?php endif; ?>
$('input[name="task"]').val('empayment.send');
$('input[name="processor"]').val($(this).data('payment-gateway'));
$('#formsubscr').submit();
});
$('#payfree').click(function() {
$('input[name="task"]').val('empayment.send');
$('#formsubscr').submit();
});
$('#apply-btn').click(function() {
$('input[name="task"]').val('empayment.coupon');
$('#formsubscr').submit();
});
}(jQuery))
function load(value) {
value = parseInt(value);
if(value > 0) {
loadText(value);
} else if(value == -1) {
loadForm();
}
}
var inv_dat = jQuery('#invoice_data');
function loadText(value) {
inv_dat.hide();
jQuery.ajax({
url: '<?php echo JRoute::_('index.php?option=com_emerald&task=empayment.getinvoicetext', FALSE); ?>',
type: 'GET',
dataType: 'html',
data: {id: value}
}).done(function(html) {
inv_dat.html(html).slideDown('fast');
});
}
function loadForm() {
inv_dat.hide();
jQuery.ajax({
url: '<?php echo JRoute::_('index.php?option=com_emerald&task=empayment.getinvoiceform', FALSE); ?>',
dataType: 'html'
}).done(function(html) {
inv_dat.html(html).slideDown('fast');
jQuery('#invoiceto_fields_country')
.chosen({
disable_search_threshold: 10,
allow_single_deselect: true
});
});
}
</script>

Sergey
Total posts: 13,702
22 Mar 2020 07:51

Try to edit plan #9


lmarazzo VIP
Total posts: 98
22 Mar 2020 23:30

I dont know what's the problem! The Online Music Guild has the SAME template. Plans have the same configuration. Free plans check out without a problem. I dont know why the gateway is being pulled up since the gateway is not even needed for a free plan!

Bests

LM


Sergey
Total posts: 13,702
23 Mar 2020 16:01

I cannot test it because I need to login.


Sergey
Total posts: 13,702
25 Mar 2020 05:06

I've found a reason. That is because you use @ in a coupon name.


lmarazzo VIP
Total posts: 98
25 Mar 2020 13:45

excelent! now I got this: EBDE5DFD-9BC6-424D-B759-16A33BB1A946

Replay Topic
Uploading
Click here to upload and insert file from you hard drive: (png, gif, jpg, jpeg, zip, txt, rar)
Powered by Cobalt