Button buy all images in Gallery problem

Hi,

I have added a button to buy all images in the gallery. I created a physical image as a dummy. When button clicked, the product is added to cart. No Problem so far.

BUT - after completing the checkout either customer nor I get an E-Mail notifying this buy.
But what’s worst: When I check in Cart module → orders: I can not see which this “all images” belongs to. Background: We have hundreds of albums like 001,002,003,… Each belong to a different kindergarten. So how do I know which album was bought. I can not see any info in orders :frowning:

Any idea?

Why are we doing this? Well, BL has no built in feature for our customers to buy all digital images. That’s why I added this dummy. After the customer ordered the whole gallery, we send him/her a download link.

Thanks
Elmar

Are you using a unique pricing scheme with a unique Product for each album’s “Buy All” button?

No, I have only one product. Can not create hundreds of them :slight_smile:

That’s why you don’t know which album the order relates to.

any idea how to have the album number in the order?

If you don’t want to create a Buy All product for each album. (e.g. “Buy All album xxx”) and pricing schemes for each, you could try adding a field to the checkout (cart > settings > Additional Fields) and name it something like “Album name for Buy All purchases”
It would then be up to your customers to enter the name of the album in that field when checking out.

That I also thought about. Will have a look if this is working. Could create it as “required” field :slight_smile:

And what about mails not sent when only this product is checked out? All other checkouts with “normal” products physical as well as virtual is working fine

I don’t know. Does the transaction go through otherwise? Are you getting payments? (assuming you’re using PayPal)

@Ben will likely need to take a look.

If you use phplugins, you should be able to automatically set the data-item and data-name attributes to something that lets you identify the album.

Oh - could you explain this in more depth? Don’t understand :frowning:

Maybe something like this? This goes into your Pangolin phplugins file. It adds the buy button to all of your Kunden Galerien. Set data-item according to your cart settings. data-name contains the album title. Hopefully, it will appear in your invoice.

Vielleicht funktioniert es ja auch. Viel Glück!


// returns true if $page matches current page or any of its sub-pages 
function dlp_page_match($page) {
   if (substr($_SERVER["REQUEST_URI"], 0, strlen($page)) == $page) {
      return true;
   }  else {
      return false;
   }
}

function album_top(){

	// add buy button to kunden-galerien album pages
	if ($this->dlp_page_match('/galleries/kunden-galerien/')){
		$album = $this->album;
		$album_title = $album->getTitle();
		// add buy button
		echo '<p><button class="add-to-cart" data-item="item-code" data-name="'.$album_title.'" data-price="25">Alle Kaufen</button><br><br></p>';
    }
   return true;
}
1 Like

Nice! I just tested it out and it works great in placing the album name in the Item Name column of the order and customer invoice.

1 Like

Great! Happy that it works. Thank you for checking it, @rod_barbee!

@Daniel

…works perfect! This really saved my a… :slight_smile: Thanks so much! Even invoices are now sent again when buying only the “Alle Bilder” item is choosen.

1 Like