Using Ubercart to sell files: ui improvements and creating file feature programmatically

uc_file module that allows selling files in Ubercart is definitely not perfect in terms of API, but it is a nice piece of functionality.
We’ve just finished creating one e-book store which has product-import feature.
Each product has multiple formats (pdf, epub, rtf) - some products can have pdf+epub, some can have just pdf, others have all three formats attached.

On product page, we wanted to show nice block like this:

Ubercart file downloads

where pdf and doc are just text for regular users, and download links for users that already bought this book.

All the code was created for Drupal 7 + Ubercart 7.x-3.x Read more »

Calendar with highlighted dates

In Drupal 7, it’s easy to show calendar (ui.datepicker) date selector to user. (it’s not hard in Drupal 6, too - but in d6 you need to enable to get the calendar, I think)

You just write several lines of js code, and you get a calendar.
But things are quickly getting more complicated when you need to allow visitors to choose from dates that have some nodes “attached” to them only. E.g. if you have news view, and you don’t have news for 13 Nov 2011, there is no sense in allowing user to click on this date in calendar (I’m talking about the case when clicking on calendar redirects user to views page /news/2011/11/02 , where 2011/11/02 is a context filter for news nodes)

Here is the screenshot illustrating the desired functionality: Read more »

Writing robust code that uses fields, in Drupal 7

In Drupal 7, the direct access to entity fields (CCK in d6) is different. In Drupal 6 you write:

= $node->field_yourfield[0]['value'];

in Drupal 7 you have to write:

= $node->field_yourfield[LANGUAGE_NONE][0]['value'];

(this is a way suggested by core docs).
So, we have different languages here now.

I haven’t built any d7 multilanguage websites yet, so I don’t know if that approach makes it really easy to create language-aware code for i18n websites (I hope it does!), but for regular single language websites this approach just adds some headaches to the developers. Read more »

Commerce Product Constructor

Today I’ve made another decision to postpone using Commerce in our project where customer needed simple e-shop. I’ve actually made such decisions several times already, and that makes me feel unhappy.
I would like to say that I really enjoy Commerce presentations, (like everyone of you, huh?), and test installations are working great!
The idea of Drupal-way, and Rules, and Views-everywhere rocks.

But… Commerce is being developed for a long time already, and you still can’t show it to your customers if they need to log in to admin section of their website!


That’s node display + product entity problem.

In Commerce, product entity is a primary thing, and this is an item that holds product-specific data like SKU and price. Read more »

Additional CCK powered price for product in Ubercart

I was not updating my blog for a while - it’s summer here :)
I’ve just returned back from my business trip to US, Alaska, where I helped guys from killer to automate their warehouse and create good user control panel in their website (everything is Drupal-powered here!). I’ve also spent several days surfing in San Diego. It’s so exciting to realize that Drupal knowledge can give you an opportunity to visit such amazing places and meet interesting and smart people all over the world!

Today I will tell you about small, but cool feature which makes Ubercart website pricing even more flexible.
The code was designed to work in Drupal 6.x + Ubercart 2.4.

There is a lot of Ubercart modules that provide separate prices for some specific conditions. Read more »

CSRF: Avoid security holes in your Drupal forms.

While everyone is now aware of SQL injections and 99% of Drupal developers now use placeholders in their db queries, some of other important security aspects are often forgotten.

Today I’ve encountered another example of CSRF (Cross-site request forgery in Wikipedia) in Drupal contributed module.

It’s so easy to create a CSRF security hole while creating a module. Here is the short description of the issue. Read more »

New UI in Views

It’s so exciting to see how such huge improvements happen.
I’ve just updated one of my 7.x websites to latest dev of views and ctools, and noticed that Views UI got major overhaul:

  1. New Views wizard

Be careful with Views Custom Field

I was tearing my hair out over mysterious bugs in my recent Drupal project. Our complex views pages, which used Views custom field extensively, were constantly breaking. The php field output could break when new CCK field was added to some node type, or some value was selected in views exposed filters.
The code of my phpfields was very simple, something like this:

if ($data->field_node_status_value > 2) {
l("Some action", 'test/url');
Read more »

EMS shipping module for Ubercart

I’ve just created EMS Russian Post shipping module. It will be useful for store owners in Russia.

The module supports delivery price calculation outside Russia (and in Russia, obviously).
Caching was implemented to minimize requests to EMS Russian Post website.

Module screenshots:
EMS Russian Post

No connection to EMS website” use case demonstration:
EMS no connection

Settings page: Read more »

It's time for updates

There were no updates to our themes section for a while. We were busy building big customer projects, but at last, we managed to take a break to bring our own products to new level of maturity.

The main news are:

  1. Our premium themes now use Pixeljets Core theme (which is free), so every subtheme inherits its styles, theme settings, and all the other stuff under the hood. I’m excited with all these new cool admin section styles and iPhone sliders in theme settings, that is what I call premium :) and I’m sure our customers will like them. Check Core theme details page to learn more.

Recent comments

"I agree most of your points. Did you look at Riot.js? "
by kiichi2 weeks 4 days ago
"Would not like to say much, just that Vue is better choice if you wanna reinvent the wheels. "
by Artzyme.com2 weeks 4 days ago
"Interesting post! I needed to make the same decision between Vue, Angular and react. Angular is just too much overhead, and Vue looked lightweight and promising. However, React still won me over for...
by K2 weeks 5 days ago
"Oh, GOOD POINT! I also rebult my project with vue2 and yii2 these days. But I got an issue that, I didn't know how to use the csrf method of yii2. Because I threat the front end project as a static...
by Sid3 weeks 22 hours ago
"Why is Chinese language part of the cons? Are you a racist? If not, then that should not be an issue. (I'm not Chinese) "
by Sallar3 weeks 1 day ago
Drupal association member