Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

*Fix product page to show model numbers when varients are used. If availa #17

Closed
wants to merge 3 commits into from

1 participant

@dannyhenderson

*Fix product page to show model numbers when varients are used. If availability element was not present the javascript fails.

You can see this in the test shop by going to the osc T-shirt. There is no model shown, so this fix shows the model and allows it to change with the dropdown.

Thanks,

Danny

@dannyhenderson

Added an update the the product listing css and removed the tables to use div's

@dannyhenderson dannyhenderson *Remove bug introduced in Messagestack class
Commit 3604265dd6d0eac5892b 'Prevent Duplicate Messagestack notices' does not check to see if a key exists resulting in undefined index errors.
c522850
@dannyhenderson

Your recent commit introduced a small bug in the message stack class

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Apr 5, 2011
  1. @dannyhenderson

    *Fix product page to show model numbers when varients are used. If av…

    dannyhenderson authored
    …ailability element was not present the javascript fails.
  2. @dannyhenderson

    *Update product listing to use div's instead of tables

    dannyhenderson authored
    *Mirror site style for product listing
  3. @dannyhenderson

    *Remove bug introduced in Messagestack class

    dannyhenderson authored
    Commit 3604265dd6d0eac5892b 'Prevent Duplicate Messagestack notices' does not check to see if a key exists resulting in undefined index errors.
This page is out of date. Refresh to see the latest.
View
2  osCommerce/OM/Core/MessageStack.php
@@ -85,7 +85,7 @@ public function add($group = null, $message, $type = 'error') {
$stack = array('text' => $message,
'type' => $type);
- if ( !in_array($stack, $this->_data[$group]) ) {
+ if ( !array_key_exists($group, $this->_data) || !in_array($stack, $this->_data[$group]) ) {
$this->_data[$group][] = $stack;
}
}
View
19 osCommerce/OM/Core/Site/Shop/Application/Products/pages/product_listing.php
@@ -49,8 +49,8 @@
if ( count($products_listing['entries']) > 0 ) {
?>
- <table border="0" width="100%" cellspacing="0" cellpadding="2">
- <tr>
+ <div class="productListing">
+ <div class="ui-widget productListing-heading">
<?php
for ($col=0, $n=sizeof($column_list); $col<$n; $col++) {
@@ -99,13 +99,16 @@
$lc_text = Products::getListingSortLink($lc_key, $lc_text);
}
- echo ' <td align="' . $lc_align . '" class="productListing-heading">&nbsp;' . $lc_text . '&nbsp;</td>' . "\n";
+ echo ' <div class="ui-widget-header productListing-data">' . $lc_text . '</div>' . "\n";
}
?>
- </tr>
+ </div>
<?php
+
+
+
$rows = 0;
foreach ( $products_listing['entries'] as $p ) {
@@ -113,7 +116,7 @@
$rows++;
- echo ' <tr class="' . ((($rows/2) == floor($rows/2)) ? 'productListing-even' : 'productListing-odd') . '">' . "\n";
+ echo ' <div class="' . ((($rows/2) == floor($rows/2)) ? 'productListing-even' : 'productListing-odd') . '">' . "\n";
for ($col=0, $n=sizeof($column_list); $col<$n; $col++) {
$lc_align = '';
@@ -165,14 +168,14 @@
break;
}
- echo ' <td ' . ((empty($lc_align) === false) ? 'align="' . $lc_align . '" ' : '') . 'class="productListing-data">' . $lc_text . '</td>' . "\n";
+ echo ' <div ' . ((empty($lc_align) === false) ? 'align="' . $lc_align . '" ' : '') . 'class="productListing-data">' . $lc_text . '</div>' . "\n";
}
- echo ' </tr>' . "\n";
+ echo ' </div>' . "\n";
}
?>
- </table>
+ </div>
<?php
} else {
View
4 public/sites/Shop/javascript/products/info.js
@@ -68,6 +68,8 @@ function refreshVariants() {
}
document.getElementById('productInfoPrice').innerHTML = price;
- document.getElementById('productInfoAvailability').innerHTML = availability;
+ if(document.getElementById('productInfoAvailability') != undefined) {
+ document.getElementById('productInfoAvailability').innerHTML = availability;
+ }
document.getElementById('productInfoModel').innerHTML = model;
}
View
25 public/sites/Shop/templates/oscom/stylesheets/general.css
@@ -293,34 +293,47 @@ TD.infoBox, SPAN.infoBox {
font-size: 12px;
}
-TR.accountHistory-odd, TR.addressBook-odd, TR.alsoPurchased-odd, TR.payment-odd, TR.productListing-odd, TR.productReviews-odd, TR.upcomingProducts-odd, TR.shippingOptions-odd {
+TR.accountHistory-odd, TR.addressBook-odd, TR.alsoPurchased-odd, TR.payment-odd, TR.productReviews-odd, TR.upcomingProducts-odd, TR.shippingOptions-odd {
background: #f8f8f9;
}
-TR.accountHistory-even, TR.addressBook-even, TR.alsoPurchased-even, TR.payment-even, TR.productListing-even, TR.productReviews-even, TR.upcomingProducts-even, TR.shippingOptions-even {
+TR.accountHistory-even, TR.addressBook-even, TR.alsoPurchased-even, TR.payment-even, TR.productReviews-even, TR.upcomingProducts-even, TR.shippingOptions-even {
background: #f8f8f9;
}
-TABLE.productListing {
+.productListing {
+ display: table;
+ width: 100%;
border: 1px;
border-style: solid;
- border-color: #b6b7cb;
+ border-color: #4297D7;
border-spacing: 1px;
}
.productListing-heading {
+ display: table-row;
font-family: Verdana, Arial, Helvetica, sans-serif;
font-size: 12px;
- background: #b6b7cb;
color: white;
font-weight: bold;
}
-TD.productListing-data {
+.productListing-data {
+ display: table-cell;
+ vertical-align: middle;
font-family: Verdana, Arial, Helvetica, sans-serif;
font-size: 12px;
}
+.productListing-even {
+ display: table-row;
+ background: #f8f8f9;
+}
+.productListing-odd {
+ display: table-row;
+ background: #f8f8f9;
+}
+
A.pageResults {
color: #0000FF;
}
Something went wrong with that request. Please try again.