Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Simple payments styling #7500

Merged
merged 13 commits into from
Jul 24, 2017
Merged

Conversation

artpi
Copy link
Contributor

@artpi artpi commented Jul 21, 2017

zrzut ekranu 2017-07-21 o 18 28 28

Please continue

@lamosty lamosty removed their assignment Jul 21, 2017
<div class='jetpack-simple-payments-price'>{$data['price']}</div>
{$items}
<div class='jetpack-simple-payments-button' id='{$data['dom_id']}_button'></div>
<div class='jetpack-simple-payments-payment-row'>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should name the classes as jetapck-simple-payments__payment-row. At least that's what we do in Calypso and it's quite nice. Can we rework it?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor

@retrofox retrofox Jul 22, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

image

We should update the css class names according to this.

@iamtakashi
Copy link
Contributor

iamtakashi commented Jul 21, 2017

If this was on Twenty Sixteen:

image

@lamosty
Copy link
Contributor

lamosty commented Jul 21, 2017

Please merge #7495 before this PR since I've refactored class names.

@@ -94,9 +95,11 @@ function output_shortcode( $data ) {
<div class='{$data[ 'class' ]} jetpack-simple-payments-wrapper'>
<div class='jetpack-simple-payments-title'>{$data['title']}</div>
<div class='jetpack-simple-payments-description'>{$data['description']}</div>
Copy link
Contributor

@iamtakashi iamtakashi Jul 21, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we have <p> inside of div.jetpack-simple-payments-description? Themes most likely has spacing for it and that would avoid having an arbitrary margin for this specific shortcode.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

59ea83a9dfe3373ad56fb7d3cc457768f949b3dc

@@ -94,9 +95,11 @@ function output_shortcode( $data ) {
<div class='{$data[ 'class' ]} jetpack-simple-payments-wrapper'>
<div class='jetpack-simple-payments-title'>{$data['title']}</div>
Copy link
Contributor

@iamtakashi iamtakashi Jul 21, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we have <strong> inside of div.jetpack-simple-payments-title ?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually, that^ was a bad idea. Sorry, let make it bold with CSS as it was.

{$items}
<div class='jetpack-simple-payments-button' id='{$data['dom_id']}_button'></div>
<div class='jetpack-simple-payments-payment-row'>
<div class='jetpack-simple-payments-price'>{$data['price']}</div>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we have also <p> inside of div.jetpack-simple-payments-price for the same reason?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry, also <strong> please.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ignore the <strong> suggestion, sorry!

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

59ea83a9dfe3373ad56fb7d3cc457768f949b3dc

@retrofox
Copy link
Contributor

retrofox commented Jul 22, 2017

Please merge #7495 before this PR since I've refactored class names.

I'll change the class names according to this comment: #7500 (comment)

Also, we had to rebase it since there were conflicts.

@retrofox retrofox force-pushed the simple-payments/styling branch 2 times, most recently from d4a24dd to 5f77a72 Compare July 22, 2017 14:33
@retrofox retrofox self-assigned this Jul 22, 2017
@@ -16,6 +16,7 @@
.jetpack-simple-payments-price {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe you have some suggestion here @iamtakashi, using flexbox for instance. Feel free to edit this file.

@retrofox
Copy link
Contributor

retrofox commented Jul 22, 2017

body .jetpack-simple-payments__wrapper div.jetpack-simple-payments__purchase-message,
body .jetpack-simple-payments__wrapper div.jetpack-simple-payments__purchase-message a {
/* stronger rule in order to set the text color */
body .jetpack-simple-payments-wrapper div.jetpack-simple-payments-purchase-message {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As per #7495, let's change it to <p> instead of <div>.

style: {
label: 'pay',
color: 'blue'
shape: 'pill',
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just realised there is rect option for shape. I think I prefer the rectangle than the pill that feels a bit old school to me. Let's go with rect.

@retrofox retrofox force-pushed the simple-payments/styling branch from 3f0ef54 to 8c87368 Compare July 22, 2017 23:29
@retrofox
Copy link
Contributor

image

return "
<div class='{$data['class']} ${cssPrefix}-wrapper'>
<p class='${cssPrefix}-purchase-message'></p>
<div class='${cssPrefix}-title'>{$data['title']}</div>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it's safer to have <p> inside of the <div> as well. This will likely add bottom margin to the title, but we actually need it. If the product doesn't have description there wouldn't be spacing between the title and the price.

Copy link
Contributor

@iamtakashi iamtakashi Jul 22, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

<div class='${cssPrefix}-title'><p>{$data['title']}</p></div>

<div class='{$data['class']} ${cssPrefix}-wrapper'>
<p class='${cssPrefix}-purchase-message'></p>
<div class='${cssPrefix}-title'>{$data['title']}</div>
<p class='${cssPrefix}-description'>{$data['description']}</p>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's good that we now have <p> around the price but can we keep the outer div we had?

<div class='${cssPrefix}-description'><p>{$data['price']}</p></div>

<div class='${cssPrefix}-title'>{$data['title']}</div>
<p class='${cssPrefix}-description'>{$data['description']}</p>
<div class='${cssPrefix}-purchase-box'>
<p class='${cssPrefix}-price'>{$data['price']}</p>
Copy link
Contributor

@iamtakashi iamtakashi Jul 22, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

<div class='${cssPrefix}-price'><p>{$data['price']}</p></div>

@iamtakashi
Copy link
Contributor

Please work on the image part ASAP. The style and markup can be tweaked after.

@@ -12,6 +12,8 @@ class Jetpack_Simple_Payments {

static $shortcode = 'simple-payment';

static $cssClassnamePrefix = 'jetpack-simple-payments';
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

PHP is snake_case

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:-o thanks

";
return $output;

return "
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This will make tabs in site html code as well, it was tabbed to the left so we dont print out unnecessary tabs

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ic, I thought it was a mistake. Reverting now.

Copy link
Contributor

@retrofox retrofox left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Feel free to merge before of after that #7503.

@retrofox retrofox force-pushed the simple-payments/styling branch from 764f3b0 to 2ae1da0 Compare July 24, 2017 14:16
@retrofox retrofox force-pushed the simple-payments/styling branch from 6ea277d to 67a6324 Compare July 24, 2017 14:31
<div class='jetpack-simple-payments__button' id='{$data['dom_id']}_button'></div>

return "
<div class='{$data['class']} ${cssPrefix}-wrapper'>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think adding the class name prefix as a variable is not very helpful. It's harder to read the styling then and I've never seen class naming in a variable. :) We are also not going to change the class name prefix I think -- why would we?

margin-top: 0.3em;
}

.jetpack-simple-payments-price {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We could use flexbox (like we do in Calypso Editor previews) or at least clear the floats in the parent div.

@iamtakashi
Copy link
Contributor

The QTY field still doesn't appear in my testing.

Copy link
Contributor

@lamosty lamosty left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

image

@artpi
Copy link
Contributor Author

artpi commented Jul 24, 2017

I dont think that is what we want:
It is worse than state from 7e8d9ab
zrzut ekranu 2017-07-24 o 17 13 31

@retrofox retrofox merged commit bcd211f into feature/simple-payments Jul 24, 2017
@matticbot matticbot removed the [Status] Needs Review This PR is ready for review. label Jul 24, 2017
eliorivero pushed a commit that referenced this pull request Jul 25, 2017
* Introduce Jetpack_Simple_Payments class, load it

* Add doc about format to CPT

* Add more docs

* Add enabled / disabled status

* Add shortcode

* reg shortcode

* Add shortcode logic

* Fix func

* fix class

* rename to product

* Better content passing

* Pass proper JS

* Add comments

* Rename to "paypal-express-checkout"

* Add price

* Label change

* jshint fixes

* filter

* items

* Throw error if paypal not defined

* Info about script hosted with PP

* Get rid of static keyword

* Fix some lint issues

* proper header

* Adjust classes to WP coding standards

* Change header

* Change comment

* add payload for number of items

* Make ids work for paypal code

* repair init code

* Introduce ID for form

* Add endpoint urls

* Better domain

* Endpoint urls with blog_id

* Fix id

* Add version

* Change endpoint

* Make sandbox

* Add post meta syncing

* Sandbox management

* Review fixes

* remove console

Attempt to make test pass in JS

* Fir for missing product

* simple-payments: print message when the transaction ends.

* simple-payments: clean message placeholder

* simple-payments: implement styles to the block

* some change

* simple-payments: improve showing transaction messages

* Put the purchase message into HTML, hidden by default

* Toggle purchase messages with either success/error and message

* Use p tag instead of div with margin

Props @iamtakashi for the suggestion.

* Remove unneeded code

* Fix typo

* Fix paypal checkout.js script error

* Use .html instead of text to append html content

* Removing one error message: there's no error to show, uneeded

* Fix toggle logic of the purchase message

* fix linting issue

* update success copy

* simple-payments: small coding improvements in output_shortcode()

* simple-payments: do not use underscore in css class
https://make.wordpress.org/core/handbook/best-practices/coding-standards/css/#selectors

* simple-payments: minor improvements defining endpoints

* simple-payments: use `<p>` tag for description and price
#7500 (comment)

* simple-payments: minor improvements

* simple-payments: add purchase-box container. improve paypal button styles.

* Simple Payments: update error message handling (#7503)

- display success message from backend ( D6514-code )
- display all error messages

* simple-pyaments: wrap all text into `<p>` elems

* simple-payments: move globals as PaypalExpressCheckout properties

* simple-payments: coding improvementes.

* simple-payments: minor code improvements

* rebase: squash -> "simple-payments: move globals as PaypalExpressCheckout properties"

* Remove wpautop for Simple Payments product content/description (#7507)

* Simple payments: image (#7508)

Introduces an image to a payment button

* Disable default sandboxing

* simple-payments: user camel-case convention

* reenable sandbox

* Add env handling

* Simple Payments: Style shortcode

* simple-payments: inject msgs in the right place

* simple-payments: show error in onAuthorize callback

* fix additional error messages

* Simple Payments: Modify message style

* fix empty join call

* Simple Payments: Reset iframe margin

* wrap default error message

* Implement review feedback

* Add min field

* SimplePayments: add formatted price meta data (#7521)

Output `spay_formatted_price` if present

* somple-payments: improve-error-handling

* simple-payments: check processErrorMessage() param

* Fixed lint errors.

* Simple Payments: return wpcom blog_id if code is running on wpcom (#7524)

* Simple Payments: add method to process success messages (#7528)

Fixes styling of success messages.
@Viper007Bond Viper007Bond deleted the simple-payments/styling branch January 29, 2018 23:18
@jeherve jeherve added the [Feature] Pay with PayPal aka Simple Payments label Aug 2, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Feature] Pay with PayPal aka Simple Payments
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants