How to customize the volusion store and integrate a "get a quote" option - volusion

I want to customize the store and have an option for the users to get a quote for the products, once clicked on the option it will send mail to admin of store about the same along with the product ID
Let me know how can this be achieved ?

I did something similar ... added a Make Offer button for any product over X amount of money. Here's what my code in the template.html looks like...
var price = $("span[itemprop='price']").html();
if ( price != null && price != 'undefined' ) {
price = price.replace("$", "");
price = price.replace(",", "");
var pname= $("span[itemprop='name']").html();
pname= pname.replace(/\W+/g, "_")
var pcode = $('.product_code').html();
if ( price > 50 )
{
$('.vCSS_input_addtocart').after('<p><input type="button" style=" text-shadow: -1px -1px 0 #006d72, 1px -1px 0 #006d72, -1px 1px 0 #006d72, 1px 1px 0 #006d72;border-radius: 6px; border: 1px solid #6E2B62; background-color:#009DA5; color:white" value="Make An Offer" onclick="window.open( \'/v/vspfiles/makeanoffer.asp?ProductCode='+pcode+'&price='+price+'&pname='+pname+' \',\'_blank\', \'width=300px, height=500px\' ) " />');
Then I have a custom ASP page that handles the email, which is another can of worms. You could more easily use the built-in email form, which is explained here...
https://support.volusion.com/hc/en-us/articles/209448057-How-to-Create-a-Storefront-Email-Contact-Form
Good luck!

Related

PhpSpreadsheet read xlsx file not correctly. Wrong reading empty combined cells

I have the following excel table:
and the following code to turn it into html table:
<style>
table, th, td {
border: 1px solid black;
}
</style>
<?php
error_reporting(E_ALL);
require 'vendor/autoload.php';
use PhpOffice\PhpSpreadsheet\Reader\Xlsx;
use PhpOffice\PhpSpreadsheet\Writer\Html;
$fileExcel = tempnam(sys_get_temp_dir(), 'excel_');
$blob = file_get_contents('./test.xlsx');
file_put_contents($fileExcel, $blob);
$reader = new Xlsx();
$spreadsheet = $reader->load($fileExcel);
unlink($fileExcel);
$writer = new Html($spreadsheet);
$sheetData = $writer->generateSheetData();
echo $sheetData;
The result seems corrupted:
I tried to find some setting on the documentation, but I did not find anything. Any ideas how to fix this behavior?

Angular UI-grid header cell icon swap

I am building a grid using angular ui-grid. The column headers have a downward chevron like so:
I would very much like to change that icon to something else. Is there a simple way to do this without having to go through the headache of creating a custom headerCellTemplate?
In the end I went another way. We added a template overtop of the existing icon as it seemed better than changing the code native to ui grid
.ui-grid-column-menu-button i{
color: white;
background: url("data:image/svg+xml;utf8,<svg version='1.1' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink' x='0px' y='0px' width='7.91px' height='13.412px' viewBox='0 0 7.91 13.412' enable-background='new 0 0 7.91 13.412' xml:space='preserve'><polyline fill='none' stroke='#FFFFFF' stroke-miterlimit='10' points='-690,-124 -697,-117 -703.969,-123.938 '/><polyline fill='none' stroke='#FFFFFF' stroke-miterlimit='10' points='-704.406,-134 -697.406,-141 -690.438,-134.062 '/><polygon fill='#FFFFFF' points='4.058,13.412 0.22,9.592 0.925,8.883 4.056,12 7.203,8.854 7.91,9.561 '/><polygon fill='#FFFFFF' points='0.707,4.56 0,3.853 3.853,0 7.69,3.821 6.985,4.53 3.854,1.413 '/></svg>");
background-position: 50% 85%;
background-repeat: no-repeat;
width: 100%;
}
Yup.
Not that this advised due to the nature of this change, but you can change the class that is responsible for appending that icon in the ui-grid.js file:
Search for ui-grid-icon-angle-down in ui-grid.js
It will appear in the following line :
"<div role=\"columnheader\" ng-class=\"{ 'sortable': sortable }\" ui-grid-one-bind-aria-labelledby-grid=\"col.uid + '-header-text ' + col.uid + '-sortdir-text'\" aria-sort=\"{{col.sort.direction == asc ? 'ascending' : ( col.sort.direction == desc ? 'descending' : (!col.sort.direction ? 'none' : 'other'))}}\"><div role=\"button\" tabindex=\"0\" class=\"ui-grid-cell-contents ui-grid-header-cell-primary-focus\" col-index=\"renderIndex\" title=\"TOOLTIP\"><span class=\"ui-grid-header-cell-label\" ui-grid-one-bind-id-grid=\"col.uid + '-header-text'\">{{ col.displayName CUSTOM_FILTERS }}</span> <span ui-grid-one-bind-id-grid=\"col.uid + '-sortdir-text'\" ui-grid-visible=\"col.sort.direction\" aria-label=\"{{getSortDirectionAriaLabel()}}\"><i ng-class=\"{ 'ui-grid-icon-up-dir': col.sort.direction == asc, 'ui-grid-icon-down-dir': col.sort.direction == desc, 'ui-grid-icon-blank': !col.sort.direction }\" title=\"{{isSortPriorityVisible() ? i18n.headerCell.priority + ' ' + ( col.sort.priority + 1 ) : null}}\" aria-hidden=\"true\"></i> <sub ui-grid-visible=\"isSortPriorityVisible()\" class=\"ui-grid-sort-priority-number\">{{col.sort.priority + 1}}</sub></span></div><div role=\"button\" tabindex=\"0\" ui-grid-one-bind-id-grid=\"col.uid + '-menu-button'\" class=\"ui-grid-column-menu-button\" ng-if=\"grid.options.enableColumnMenus && !col.isRowHeader && col.colDef.enableColumnMenu !== false\" ng-click=\"toggleMenu($event)\" ng-class=\"{'ui-grid-column-menu-button-last-col': isLastCol}\" ui-grid-one-bind-aria-label=\"i18n.headerCell.aria.columnMenuButtonLabel\" aria-haspopup=\"true\"><i class=\"ui-grid-icon-angle-down\" aria-hidden=\"true\"> </i></div><div ui-grid-filter></div></div>"
Change ui-grid-icon-angle-down to something else, perhaps a different font-awesome class (I'll use fa fa-cogs)

Make less-rails add line numbers as comment

Is there any way to configure less-rails so that it shows the line number of original sources as comments? And is it possible to enable source mapping?
Consider the following example:
file1.less
body {
background-color: black;
}
file2.less
body {
padding: 20px;
}
application.css.less
#import "file1";
#import "file1";
What I get:
body {
background-color: black;
}
body {
padding: 20px;
}
What I want
/* file1.less line: 1 */
body {
background-color: black;
}
/* file2.less line: 1 */
body {
padding: 20px;
}
Or is there any other easier way to find out which rule belongs to which file?
Update
When configuring my application, the config.less only contains the following:
{:paths=>
[#<Pathname:/home/yan-foto/.../vendor/less>,
#<Pathname:/home/yan-foto/.../node_modules/bootstrap-datetimepicker>,
#<Pathname:/home/yan-foto/.../node_modules/bootstrap-slider>],
:compress=>false}
Open the vendor/bundle/ruby/1.9.1/gems/less-2.6.0/lib/less/parser.rb file and replace (around line 54):
end
#parser = Less::JavaScript.exec { Less['Parser'].new(env) }
with:
end
env['dumpLineNumbers'] = 'comments';
#parser = Less::JavaScript.exec { Less['Parser'].new(env) }
Based on https://github.com/metaskills/less-rails#configuration you should try:
MyProject::Application.configure do
config.less.line-numbers << "comments"
config.less.compress = true
end
When the preceding works as expected you could also consider to use CSS sourcemaps:
MyProject::Application.configure do
config.less.source-map = true
config.less.source-map-map-inline = true
end
I really don't find the line config.less.line-numbers << "comments" in
docs
I fact my answer is only a suggestion and i was not able to test it. The above suggest that you are able to set some option for the Less compiler.
You can also find this option by running lessc without any argument:
-------------------------- Deprecated ----------------
--line-numbers=TYPE Outputs filename and line numbers.
TYPE can be either 'comments', which will output
the debug info within comments, 'mediaquery'
that will output the information within a fake
media query which is compatible with the SASS
format, and 'all' which will do both.
--verbose Be verbose.
and I am sure that it has a syntax error because of the dash between line
and numbers
I bet you are right about that. You should possible use: config.less.dumpLineNumbers and config.less.sourceMap
Or in your config.less: :dumpLineNumbers>comments

Wicked pdf footer at the bottom of the last page

I render a pdf that doesn't have a fixed height.
I would like to append a footer at the bottom of the last page only, I have tried to play with css but it's still showing on the footer of the first page.
Any ideas?
At this moment I have a css like this
body {
# tried with height: 100% too
height: 269mm; # a standard A4 height
}
div.footer {
position: absolute; # tried with fixed too
bottom: 0px;
height: 200px;
}
I think that the best solution is working with javascript and checking when the last page is coming, but how can I do?
Another note, seems that having:
body { height: (nr_pages * 269)mm }
is a working solution (maybe not so nice). How can I retrieve the total number of the pages (inside the view)?
You can find last page by checking whether page attribute and topage attribute is same , in js you can use following snippet in page footer layout
function subst() {
var vars = {};
var x = document.location.search.substring(1).split('&');
for (var i in x) {
var z = x[i].split('=', 2);
vars[z[0]] = unescape(z[1]);
}
var x = ['frompage', 'topage', 'page', 'webpage', 'section', 'subsection', 'subsubsection'];
for (var i in x) {
var y = document.getElementsByClassName(x[i]);
for (var j = 0; j < y.length; ++j) y[j].textContent = vars[x[i]];
if (vars["topage"] == vars["page"]) {} else {
document.getElementById("pdf-footer").innerHTML = ""
}
}
}

IOS - unwanted hyperlink in UIWebView

got this html that i insert as string to uiwebview
<div style="font-family: sans-serif;">
<p><p><u>George Barret</u> </p>
<p>Irish,
1728/1732-1784 </p>
<p><b><i>An Extensive Wooded River Landscape
with Fishermen Hauling in their Nets in the Foreground</i></b><b>, </b></p>
<p><b>1760s</b></p>
<p>Oil on canvas<br><span style="font-size: 13.513513565063477px; line-height: 19.988739013671875px;">137 x 195.5 cm</span></p>
<p>Heritage Gift, IIB Bank, 2005</p>
<p><span>NGI.4750</span></p></p></div>
i got a blue hyperlink on "1728/1732-1784"
anyone know why and how can i disable this behavior ?
Thanks
myWebView.dataDetectorTypes = UIDataDetectorTypeNone;
This will prevent your UIWebView from converting anything (phone numbers, links, email addresses) into clickable links. The attribute detectorTypes is a bitmask, and you can specify any or all of the following values OR'd together:
enum {
UIDataDetectorTypePhoneNumber = 1 << 0,
UIDataDetectorTypeLink = 1 << 1,
UIDataDetectorTypeAddress = 1 << 2,
UIDataDetectorTypeCalendarEvent = 1 << 3,
UIDataDetectorTypeNone = 0,
UIDataDetectorTypeAll = NSUIntegerMax
};
For example, to turn only email addresses and phone numbers into clickable links you would use:
myWebView.dataDetectorTypes =
UIDataDetectorTypePhoneNumber | UIDataDetectorTypeAddress;

Resources