top of page

Forum Posts

CowanMedia
Feb 28, 2019
In Coding with Velo
Hello again, I have another issue I am trying to figure out. How to display data from a number field as currency within a repeater. Currently, I have the data set as text in the collection, ie " $15,995 " which displays perfectly fine. The issue arises when a sort function is added, ie "Sort by Price (low to high)" as it sorts alphabetically not numerically causing $16,999 to display before (lower) than $5,995 To fix the sorting issue I returned to entering the data as a numerical value. The problem now exists with how the data displays, I need it to appear as $5,995 not 5995. How do I format the data to add a dollar sign ($) and a comma in the appropriate place? None of my items will contain anything cents, so no need for any decimal points. My dataset is called "NEWinventoryDataset" and the field containing the price is called "ourPrice", and this all connects to "repeaterInventory". The page us currently sitting on a testing URL https://www.401test.com/new-rvs Any help would be appreciated!
0
4
1k
CowanMedia
Feb 28, 2019
In Coding with Velo
I have an inventory (not a Wix store) page which consists of a repeater, connected to a database collection via a dataset. Simple, and basic. The displayed items in the repeater are based on two variables: a search term: "searchWord" from {local} on load or $w('#searchBar").value on 'Enter' or button click the boolean value: of "active" in the database collection (connected via "NEWinventoryDataset") Everything seems to be working fine with the exception of the "active" value. I need to filter the repeater items according to search parameters but ONLY show units with "active" checked as true. Yet on my live site I consistently see units appear in the repeater that are NOT active in the database. Here is the relevant code: import {local} from 'wix-storage'; import wixData from 'wix-data'; $w.onReady(function() { var sameWord = local.getItem("searchWord"); //searchWord set from Home page nav $w("#searchBar").value = sameWord; $w("#searchBar").placeholder = sameWord; $w('#titleCurrentSearch').text = "Inventory Search > New RVs > " + sameWord; $w('#NEWinventoryDataset').onReady(function () { search(); }); }); // I believe the problem is in this part: I require to filter to allow show ACTIVE units that match the search term with ANY of the listed parameters. function search() { $w("#NEWinventoryDataset").setFilter(wixData.filter().eq("active", true) .and(wixData.filter().contains("description", $w("#searchBar").value)) .or(wixData.filter().contains("category", $w("#searchBar").value)) .or(wixData.filter().contains("brand", $w("#searchBar").value)) .or(wixData.filter().contains("model",$w("#searchBar").value)) .or(wixData.filter().contains("title",$w("#searchBar").value)) .or(wixData.filter().contains("year",$w("#searchBar").value)) .or(wixData.filter().contains("keywords",$w("#searchBar").value)) .or(wixData.filter().contains("comparableModels",$w("#searchBar").value)) ) .then( () => { console.log("Dataset is now filtered"); $w("#NEWinventoryDataset").setSort(wixData.sort() .ascending("ourPrice") ); } ) .catch( (err) => { console.log(err); } ); } I have additional items on this page like a search bar, search by category list, search by brand list, and a clear filters buttons. I omitted them from the above code for clarity. All are working fine, with the exception of the "active" part. My client changes the available units by using the Wix Dashboard access to the databases, they need to be able to turn off and on the "active" value for the units, and have it reflected on the live page. The page in question is currently sitting at a testing URL => https://www.401test.com/new-rvs if that helps clarify anything at all. I am fairly new to code, only a few months in... What am I missing?
0
0
359
CowanMedia
Oct 26, 2018
In Coding with Velo
Hello again, I know Wix Stores can be connected fairly easy to Facebook Marketplace, however I am looking to feed the FB MP from a database collection instead of a store. I want to list my inventory on Facebook but do not wish to have an e-commerce setup for these products, but rather people need to book a demo as financing is required for what I am selling. Has anyone synced Facebook Marketplace with Wix without using a Wix Store?
1
1
68
CowanMedia
Oct 26, 2018
In Coding with Velo
Hello, I am trying to use the API available at https://www.carqueryapi.com/ to create a vehicle search function similar to this: The dropdown "Year" selection filters the "Make" selections to only manufacturers in production that year. Similarly, the "Make" filters the "Model", which then filters the "Trim". There is a ton of documentation on the CarQueryAPI website about how to integrate and call their API, however it does not appear the work well with WIX (at least with my limited coding knowledge). The API's documentation says to include the jQuery and the CarQuery javascript libraries in the <head> of your document; jQuery library before the carquery js file. <script type="text/javascript" src="http://www.carqueryapi.com/js/jquery.min.js"></script> <script type="text/javascript" src="http://www.carqueryapi.com/js/carquery.0.3.4.js"></script> Next it says to add the following code, also to the <head> but after the previosu scripts: <script type="text/javascript"> $(document).ready( function() { //Create a variable for the CarQuery object. You can call it whatever you like. var carquery = new CarQuery(); //Run the carquery init function to get things started: carquery.init(); //Optionally, you can pre-select a vehicle by passing year / make / model / trim to the init function: //carquery.init('2000', 'dodge', 'Viper', 11636); //Optional: Pass sold_in_us:true to the setFilters method to show only US models. carquery.setFilters( {sold_in_us:true} ); //Optional: initialize the year, make, model, and trim drop downs by providing their element IDs carquery.initYearMakeModelTrim('car-years', 'car-makes', 'car-models', 'car-model-trims'); //Optional: set the onclick event for a button to show car data. $('#cq-show-data').click( function(){ carquery.populateCarData('car-model-data'); } ); //Optional: initialize the make, model, trim lists by providing their element IDs. carquery.initMakeModelTrimList('make-list', 'model-list', 'trim-list', 'trim-data-list'); //Optional: set minimum and/or maximum year options. carquery.year_select_min=1990; carquery.year_select_max=1999; //Optional: initialize search interface elements. //The IDs provided below are the IDs of the text and select inputs that will be used to set the search criteria. //All values are optional, and will be set to the default values provided below if not specified. var searchArgs = ({ body_id: "cq-body" ,default_search_text: "Keyword Search" ,doors_id: "cq-doors" ,drive_id: "cq-drive" ,engine_position_id: "cq-engine-position" ,engine_type_id: "cq-engine-type" ,fuel_type_id: "cq-fuel-type" ,min_cylinders_id: "cq-min-cylinders" ,min_mpg_hwy_id: "cq-min-mpg-hwy" ,min_power_id: "cq-min-power" ,min_top_speed_id: "cq-min-top-speed" ,min_torque_id: "cq-min-torque" ,min_weight_id: "cq-min-weight" ,min_year_id: "cq-min-year" ,max_cylinders_id: "cq-max-cylinders" ,max_mpg_hwy_id: "cq-max-mpg-hwy" ,max_power_id: "cq-max-power" ,max_top_speed_id: "cq-max-top-speed" ,max_weight_id: "cq-max-weight" ,max_year_id: "cq-max-year" ,search_controls_id: "cq-search-controls" ,search_input_id: "cq-search-input" ,search_results_id: "cq-search-results" ,search_result_id: "cq-search-result" ,seats_id: "cq-seats" ,sold_in_us_id: "cq-sold-in-us" }); carquery.initSearchInterface(searchArgs); //If creating a search interface, set onclick event for the search button. Make sure the ID used matches your search button ID. $('#cq-search-btn').click( function(){ carquery.search(); } ); }); </script> However, unless I am missing something, I can not add anything directly to the <head> of my wixsite. Next is adding the elements named to work with the script" <select name="car-years" id="car-years"></select> <select name="car-makes" id="car-makes"></select> <select name="car-models" id="car-models"></select> <select name="car-model-trims" id="car-model-trims"></select> I can not figure out how to make this work within a wixsite, they offer a wordpress plugin, but I do not want to use wordpress. I require the user to select Year, Make, Model, and Trim levels within an extended contact form. This information is then submitted via email along with many other variables. I did manage to find a way to work this by manually collecting all the data contained within the API and creating Wix collections... this is very time consuming however and I have not completed all the entries. I compiled the years easy enough, and then I even made the list of Makes per year for 1990-2018, but for models and trim I have only completed Acura 1990-2018 and it took way too long! There must be a better way to directly call the CarQueryAPI without all these extra database collections and data entry. Please help!
Fetch data from 3rd party API to populate dropdown options content media
0
5
1k
CowanMedia
Aug 27, 2018
In Coding with Velo
I've been struggling to find a direct solution for a very specific issue. What I am trying to achieve: Drop-down 1: Year Drop-down 2: Make (dependent on year) Drop-down 3: Model (dependent on year+make) Drop-down 4: Trim (dependent on year+make+model) I have a database with year, make, model, and trim options for cars. I need to create a form where the user selects a vehicle year, and then make (dependent on year), and then subsequently the model, and trim. Each option being dependent on the selections of the previous options. (I don't want "trim: quad cab super duty" showing up for a 2012 Honda Civic). How can I achieve this while using a single database? I have found solutions that work great for the first two drop-downs (ie year then make), but these seem to fail as soon as I need a third and forth drop-down. I am hoping there is an easy solution without writing tons of code. I appreciate any help!
0
2
189

CowanMedia

More actions
bottom of page