django oscar - Dashboard/voucher - dashboard

I'm not able to add voucher from the dashboard. The Datetimepicker field doesn't pick the date.
In django-oscar==1.5.1, Django==1.10.8
Thank you

replace <script src="{% static "oscar/js/inputmask/jquery.inputmask.bundle.js" %}"></script>
with <script src="{% static "oscar/js/inputmask/jquery.inputmask.bundle.min.js" %}"></script> in your dashboard/layout.html file. Make sure you have the minified version of the above file in you project's local path.
Django oscar has a feature branch feature/datetime-for-vouchers, refer this for crosschecking and more info.

It worked, Thank you very much it helped me a lot.
Thanks for spending your valuable time, most of them don't answer the question only the few who are passionate about this field

Related

Laravel MIX not working, using CDN does work

I'm a bit lost here. I'm NOT new to Laravel Mix so this is really confusing.
I have a layout blade file and it looks something like this
<html> ....
<script src="https://cdnjs.cloudflare.com/ajax/libs/KaTeX/0.9.0/katex.min.js"></script>
<script src="{{ mix('/js/myjs.js") }}></script>
</body>
</html>
The myjs.js is compiled using Laravel Mix and contains dozen of libraries and all of them compile and work properly.
However if I include this
require('katex'); //so it's above everything else to simulate situation from above, when it's included in the layout file
...
and drop the CDN script from the layout file - the Katex library won't work.
I tried using require('katex/dist/katex.min.js') but still nothing. The katex.min.js file in the library and the one in CDN are the same.
I'm not expert on npm and I only use it to fetch libraries and then merge and minify them in my Laravel app.
Can anyone help me pin point the problem here or point me to what am I doing/getting wrong here?
Shouldn't the
<script src="lib1.js"></script>
<script src="lib2.js"></script>
included in the html, and
require('lib1')
require('lib2')
compiled to
<script src="{{ mix('compiled.js') }}"></script>
produce the same thing?
Thanks!
UPDATE:
I'm using Katex to implement this summernote plugin.
Katex should be installed as:
window.katex = require('katex');

The requested URL /image.jpeg was not found on this server

I've got a Laravel in hosting company and I get this error:
The requested URL /image.jpeg was not found on this server.
This also happens with some CSS and JS files but not all the files. What could be? In my localhost environment everything works fine. Can it be some CPanel configuration that I'm missing?
Thank you :)
The standard way to do this is use asset() function. For example, I have example1.js file that I want to import/include/use in my application, I have to use the following code.
<script src="{{ asset('example1.js') }}" type="text/javascript"></script>
If you want to load image named exampleimage.jpg, You have to use the following code.
<img src="{{ asset('exampleimage.jpg') }}" />
You have to store images, Javascript, and CSS in public folder.
Let me know if it works. According to your question, this is your answer. Let me know if you have any more questions.

Django-stripe-paymants and eldarion-ajax subscribe JSON response

I am working with Django-stripe-paymants and it's working except for handling the JSON response after the subscribe form is completed. They payment is processed and the web hooks look good.
But it is just showing the JSON is browser window.
ie:
{"html": "\n\n\n<div class=\"subscribe-form\">\n <h2>Purchase a Subscription.....
I imagine there is something small missing in the Java script, but am stuck.
I have read through the documentation a few times and searched around for a solution. The common cause for this was not including bootstrap-ajax.js. Since the last relevant issue I can find, bootstrap-ajax has been renamed eldarion-ajax.
My base template includes:
<script src="{% static 'js/vendor/checkout.js' %}"></script>
<script src="{% static 'js/vendor/jquery-1.11.0.min.js' %}"></script>
<script src="{% static 'js/vendor/eldarion-ajax.min.js' %}"></script>
Any pointers will be appreciated. Javascript is not my strong point..
Thanks!
I realise it looks like you've figured out an answer to your own question, however I had a very similar issue with my Django-stripe-payments + eldarion-ajax app and I managed to get jQuery v1.11.0 to work ok. Please check here for my answer.

jQuery Tags Manager – page is going to be reloaded with get variable

I've tried to implement the jQuery Tags Manager (http://welldonethings.com/tags/manager) the last days in vain...
What the environment looks like:
it is a bootstrap powered website with several elements on it which should be able to be tagged (within a bootstrap modal).
What I have done so far:
I have added the tagManager class to my input field.
<form>
<input type="text" name="tags_0" placeholder="Tags" class="tagManager">
</form>
Furthermore, in the head section of my website I have included a custom javascript file:
<script type='text/javascript' src="js/javascript.js"></script>
The file looks like this:
jQuery(".tagManager").tagsManager();
Of course also the jQuery lib and the bootstrap & TagsManager css files were included.
However when ever I am entering a tag it does reload the website with the get-variable "?tags_0=test"
I am kind of frustrated right now. It seems so simple, but I cannot get it working...
Best regards,
Nico
This probabily isn't going to help the original poster since this was asked some time ago, but I was having the exact same problem and when I searched for help I found this question, so my answer might help someone that ends up here with the same problem.
I was trying to use this jQuery plugin as well and I was having a hard time to get it working too. Spent hours checking the code and searching for help but always got to the conclusion that the code was correct, so I had no idea what was wrong. However, somehow, it then started working.
One thing I noticed was that if I had the call for the css file first and then the js files, it would show some weird thing in the place where it should have the "x" for deleting the tag. But if I called the js files first and then the css file, it would work perfectly.
This is the code I used:
<head>
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script>
<script type="text/javascript" src="bootstrap-tagmanager.js"></script>
<link href="bootstrap-tagmanager.css" rel="stylesheet" type="text/css">
</head>
<body>
<input type="text" name="products" placeholder="Add your Products" class="tagManager">
<script>
jQuery(".tagManager").tagsManager();
</script>
</body>
Hope this helps someone.

How to cache the static java scripts in asp.net mvc 3

I want to cache 3-4 scripts which is called in master page , how can i do that , any suggestions or tutorial will be help full.
Thanks
Regards
Static files such as javascripts and CSS are already cached by clients browsers. So no need to do anything special. Simply reference them as usual: <script type="text/javascript" src="..."></script>.

Resources